# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273841375 -10800 # Node ID e4592d119491ec2c4947dcc7cc1616cb15e497ce # Parent 84d9eb65b26fcfb9314a52b7e16bedea33d40683 Revision: 201017 Kit: 201019 diff -r 84d9eb65b26f -r e4592d119491 inc/conversationidpsconsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/conversationidpsconsts.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,28 @@ +/* + * 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: Publish and subscribe constants used to publish + * conversation id for hiding notification. + * + */ + +#ifndef CONVERSATIONID_PS_CONSTS_H +#define CONVERSATIONID_PS_CONSTS_H + +const qint32 KMsgCVIdProperty = {0x2002E678}; // same as msgnotifier's UID +const quint32 KMsgCVIdKey = 0x00000001; + +// msgapp UId +const TUid KMsgAppUid ={0x2001FE79}; + +#endif // CONVERSATIONID_PS_CONSTS_H diff -r 84d9eb65b26f -r e4592d119491 inc/msgcontacthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/msgcontacthandler.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This header handles the phonebook manager resolve number static + * functions. + * + */ + +#ifndef MSGCONTACTHANDLER_H_ +#define MSGCONTACTHANDLER_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include + +QTM_BEGIN_NAMESPACE +class QContactManager; +QTM_END_NAMESPACE + +QTM_USE_NAMESPACE + +class MsgContactHandler +{ + +public: + + /** + * This shall resolve contact number with display name + * @param contactNumber number to resolve + * @param displayName resolved name + * @param countPhoneNumber specifies number of contacts inside + * the resolved contact ex mobile, home, office etc + * @return contacts unique localId + */ + static int resolveContactDisplayName(const QString& contactNumber, + QString& displayName, + int& countPhoneNumber) + { + QContactManager * phonebookManager; + QContactDetailFilter phoneFilter; + phonebookManager = new QContactManager("symbian"); + phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, + QContactPhoneNumber::FieldNumber); + + QVariant address(contactNumber); + phoneFilter.setValue(address); + phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); + + QList matchingContacts = + phonebookManager->contacts(phoneFilter); + + if (matchingContacts.count() > 0) + { + // Fill the contact details + QContact match = matchingContacts.at(0); + + displayName = match.displayLabel(); + QList numbers = + match.details (); + countPhoneNumber = numbers.count(); + return match.localId(); + } + else // no matching contacts + { + displayName = contactNumber; + return -1; + } + } + + /** + * This shall resolve contact number with display name + * @param contactNumber number to resolve + * @param fieldName specifies filter name + * @param fieldType specifies filter type + * @return contact unique local id + */ + static int resolveContactDisplayName(const QString& contactNumber, + const QString& fieldName, + const QString& fieldType) + { + int contactId = -1; + + QContactManager phonebookManager("symbian"); + + QContactDetailFilter phoneFilter; + phoneFilter.setDetailDefinitionName(fieldName, fieldType); + phoneFilter.setValue(contactNumber); + phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); + + QList + matchingContacts = phonebookManager.contacts(phoneFilter); + + if (matchingContacts.count() > 0) + { + contactId = matchingContacts.at(0).localId(); + } + return contactId; + } + + //--------------------------------------------------------------- + // findContactList + // Finds the contact matching the phone number. + // @param phoneNumber Phone number to be matchned. + // @return List of matching contacts. + //--------------------------------------------------------------- + static QList findContactList(const QString &phoneNumber) + { + QContactManager phonebookManager("symbian"); + + QContactDetailFilter phoneFilter; + phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, + QContactPhoneNumber::FieldNumber); + phoneFilter.setValue(phoneNumber); + phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); + + QList matchingContacts = phonebookManager.contacts(phoneFilter); + + return matchingContacts; + } + + /** + * Get display-name of a contact from VCard. + * @param filePath, VCard file-path + * @return display-name + */ + + static QString getVCardDisplayName(QString& filePath) + { + QString displayName = QString(""); + //open file for parsing + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly)) + { + return displayName; + } + // parse contents + QVersitReader reader; + reader.setDevice(&file); + if (reader.startReading()) + { + if (reader.waitForFinished()) + { + QList versitDocuments = reader.results(); + // Use the resulting document + if (versitDocuments.count() > 0) + { + QVersitContactImporter importer; + QList contacts = + importer.importContacts(versitDocuments); + // get display-name + if (contacts.count() > 0) + { + //resolveSynthesizedDisplayLabel + QContactManager* contactManager = + new QContactManager("symbian"); + displayName + = contactManager->synthesizedDisplayLabel(contacts[0]); + delete contactManager; + } + } + } + } + file.close(); + return displayName; + } +}; + +#endif /* MSGCONTACTHANDLER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/messagingapp.pro --- a/messagingapp/messagingapp.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/messagingapp.pro Fri May 14 15:49:35 2010 +0300 @@ -29,3 +29,4 @@ SUBDIRS += smartmessaging/smartmessaging.pro SUBDIRS += shareui/shareui.pro SUBDIRS += msgui/msgui.pro +SUBDIRS += msgservices/msgservices.pro diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/msgappfw.pro --- a/messagingapp/msgappfw/msgappfw.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/msgappfw.pro Fri May 14 15:49:35 2010 +0300 @@ -22,4 +22,4 @@ # Platforms SYMBIAN_PLATFORMS = WINSCW ARMV5 -SUBDIRS += utils server client plugin msghistory +SUBDIRS += utils server client plugins msghistory diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/msghistory/src/msgitem.cpp --- a/messagingapp/msgappfw/msghistory/src/msgitem.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/msghistory/src/msgitem.cpp Fri May 14 15:49:35 2010 +0300 @@ -22,6 +22,7 @@ // --------------------------------------------------------------------------- MsgItem::MsgItem() { + mAttributes = MsgAttributeNone; } // --------------------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/group/csmsg.mmp --- a/messagingapp/msgappfw/plugin/group/csmsg.mmp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: CS Msg Plugin -* -*/ -#include -#include - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT -TARGET csmsg.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x2002A546 - -VERSION 1.0 - -PAGED - -// RESOURCE -START RESOURCE ../rss/csmsg.rss -TARGET csmsg.rsc -END - -SOURCEPATH ../src - -SOURCE proxy.cpp -SOURCE ccsmsg.cpp -SOURCE ccsmsgpluginutility.cpp -SOURCE ccsmsghandler.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../server/inc -USERINCLUDE ../../utils/inc -USERINCLUDE ../../../../inc -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY eCom.lib -LIBRARY csutils.lib -DEBUGLIBRARY flogger.lib - -// Msg Server -LIBRARY Smcm.lib -LIBRARY gsmu.lib -LIBRARY etext.lib -LIBRARY msgs.lib diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/inc/ccsmsg.h --- a/messagingapp/msgappfw/plugin/inc/ccsmsg.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2007 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: Message Plugin main class - * -*/ - - -#ifndef _C_CS_MSG_H_ -#define _C_CS_MSG_H_ - -// INCLUDE FILES - -// SYSTEM INCLUDES - -// USER INCLUDES -#include "ccsplugin.h" -#include "mcsmsgobserver.h" -#include "ccsdebug.h" -#include "ccsdefs.h" - -// FORWARD DECLARATION -class MCsPluginEventObserver; -class MCsMsgObserver; -class CCsConversationEntry; -class CCsMsgHandler; - -/** - * Message plugin class - * This class interacts with MsvServer to fetch the message data. - */ -class CCsMsg : public CCsPlugin, public MCsMsgObserver - { -public: - - /** - * Two phase construction - */ - static CCsMsg* NewL( MCsPluginEventObserver* aMCsPluginEventObserver); - - /** - * Destructor - */ - virtual ~CCsMsg(); - - -public: // From base class CCsPlugin - /** - * GetConversationsL - * This function starts the state machine to fetch msg data from msvserver - */ - void GetConversationsL(); - -public: //MCsMsgObserver - /** - * HandleReadCompleteL - * Sends the CCsConversationEntry array to Conversation Server - * @param aConversationEntryLists The object to be used to handle updates - * from the plugin - */ - void HandleReadCompleteL( const RPointerArray *aConversationEntryLists); - - /** - * HandleUpdateCompleteL - * Sends the CCsConversationEntry array to Conversation Server - * @param aConversationEntryLists The object to be used to handle updates - * from the plugin - */ - void HandleUpdateCompleteL( const RPointerArray *aConversationEntryLists); - - /** - * HandleDeleteCompleteL - * Sends the CCsConversationEntry array to Conversation Server - * @param aConversationEntryLists The object to be used to handle updates - * from the plugin - */ - void HandleDeleteCompleteL( const RPointerArray *aConversationEntryLists); - - /** - * HandleRefreshCompleteL - * Notify conversation server to refresh the conversations from this plugin. - */ - void HandleRefreshCompleteL(); - - /** - * HandleCachingCompleted - * Sends the cache completed status to server - */ - void HandleCachingCompleted(); - - /** - * HandleCachingError - * Sends the error occured during the caching to server - */ - void HandleCachingError(const TInt aError); - -private: - - /** - * Constructor - */ - CCsMsg(MCsPluginEventObserver* aObserver); - - /** - * 2nd phase construtor - */ - void ConstructL(); - -private: //Data - - /** - * The msg plugin class which sends the initial set of conversation - * entries upon bootup to conversations server. - * and notifies the conversations server about the new MsvServer events - */ - CCsMsgHandler* iMsgHandler; - - /** - * iPluginEventObserver - * Plugin event observer - * Not Own. - */ - MCsPluginEventObserver* iPluginEventObserver; - }; - -#endif // _C_CS_MSG_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/inc/ccsmsghandler.h --- a/messagingapp/msgappfw/plugin/inc/ccsmsghandler.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ -/* -* Copyright (c) 2007 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: Request Handler plugin - * -*/ - - -#ifndef _C_CS_MSG_REQUEST_HANDLER_H_ -#define _C_CS_MSG_REQUEST_HANDLER_H_ - -//SYSTEM INCLUDES -#include - -//USER INCLUDES -#include "ccsmsg.h" -#include "ccsmsgpluginutility.h" - - -// FORWARD DECLARATION -class CCsPlugin; -class CMsvSession; -class MCsPluginEventObserver; -class MMsvSessionObserver; -class CCsConversationEntry; -class CCsMsg; -class CCsMsgPluginUtility; -class CClientMtmRegistry; -class CSmsClientMtm; -class CMmsClientMtm; - -/** - * Operation Type - */ -enum TEventType - { - ERead, - EUpdate, - EDelete - }; - -/** - * States - */ -enum TMsgHandlerState - { - EReadInbox, - EReadSent, - EProcessDraft, - EReadOutbox, - ESortEntries, - EProcessEntries, - EComplete - }; - -/** - * Message plugin Request Handler Class - * This class interacts with MsvServer to fetch message data - */ -class CCsMsgHandler : public CBase, public MMsvSessionObserver - { - -public: - - /** - * Two phase construction - * @param aMsgObserver MCsMsgObserver interface - */ - static CCsMsgHandler* NewL(MCsMsgObserver *aMsgObserver); - - /** - * Destructor - */ - virtual ~CCsMsgHandler(); - - /** - * Start - * This function starts the state machine to fetch msg data from msvserver - */ - void StartL(); - -public://MMsvSessionObserver - /** - * Handles the MsvServer updates. Implemented for MMsvSessionObserver - */ - void HandleSessionEventL(TMsvSessionEvent aEvent, - TAny* aArg1, - TAny* aArg2, - TAny* aArg3); - -private: - - /** - * CIdle callback - */ - static TInt UploadMsg(TAny* arg); - - /** - * State handler to read all messages - */ - TInt UploadMsgL(); - - /** - * Checks if the MTM type supported - */ - TBool IsMtmSupported(long uid); - -private: - - /** - * Constructor - */ - CCsMsgHandler(); - - /** - * 2nd phase construtor - * @param aMsgPlugin The main message plugin object - */ - void ConstructL(MCsMsgObserver *aMsgPlugin); - - /** - * ProcessResultsL fetches results and updates the CCsServer - * with the fetched data - */ - void ProcessResultsL(TMsvEntry aEntry); - - /** - * Create CCsConversationEntry and adds to the list - * @param aContact, Contact details - * @param aDescription, message body - * @param aEntry, TMsvEntry - */ - void CreateAndAddEntryL(const TDesC& aContact, - const TDesC& aDescription, - const TMsvEntry& aEntry); - - /** - * Process each entry - * @param aEvent Read, Update, Delete - * @param aContact (From/To) Field - * @param aDescription, message body - * @param aEntry, Message entry - */ - void ProcessEntryL(TEventType aEvent, - const TDesC& aContact, - const TDesC& aDescription, - const TMsvEntry& aEntry); - - /** - * Process each entry - *@param aSelection, CMsvEntrySelections - *@param aParent, parent id if TMsvEntry - */ - void HandleEventL(CMsvEntrySelection* aSelection, TMsvId aParent); - - /** - * Extracts the addresses in the to field and updates them to server - *@param aEntry, TMsvEntry - *@param aEvent Read, Update, Delete - *@param aFromAddress, from address of the message - */ - void ExtractAddressesL( - TMsvEntry aEntry , - TEventType aEvent, - RPointerArray& addressList); - - /** - * Cleanup - */ - void CleanupL(); - - /** - * Extracts the Message type based on the MTM value - * @param aEntry, TMsvEntry - */ - TCsType ExtractCsType( const TMsvEntry& aEntry); - - -private: //Data - - /** - * MsvServer session object - */ - CMsvSession* iSession; - - /** - * Utility object - */ - CCsMsgPluginUtility* iMsgPluginUtility; - - /** - * iConverstationEntryList - * ConversationEntry list - * Own. - */ - RPointerArray *iConverstationEntryList; - - /** - * iMsgObserver - * The Observer interface - * Not Own. - */ - MCsMsgObserver *iMsgObserver; - - /** - * Mtm registry object - */ - CClientMtmRegistry* iMtmRegistry; - - /** - * SMS client mtm object - */ - CSmsClientMtm* iSmsMtm; - - /** - * Mms client mtm object - */ - CMmsClientMtm* iMmsMtm; - - /** - * Previous entry, used for comparing with new entry received - */ - TMsvEntry iPrevEntry; - - /** - * Root entry - */ - CMsvEntry* iRootEntry; - - /** - * Mesage count - */ - TInt iMessageCount; - - /** - * Messages under root entry - */ - CMsvEntrySelection* iMessages; - - /** - * Master array for holding all the messages - */ - RArray* iMessageArray; - - /** - * State - */ - TMsgHandlerState iState; - - /** - * Active object - */ - CIdle* iIdle; - }; - -#endif // _C_CS_MSG_REQUEST_HANDLER_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/inc/ccsmsgpluginutility.h --- a/messagingapp/msgappfw/plugin/inc/ccsmsgpluginutility.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2007 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: Utility class - * -*/ - - -#ifndef _C_CS_MSG_PLUGIN_UTILITY_H_ -#define _C_CS_MSG_PLUGIN_UTILITY_H_ - -// SYSTEM INCLUDES -#include -#include // CSmsHeader -#include -#include -#include -#include - -// FORWARD DECLARATION -class CCsConversationEntry; - -/** - * Message plugin Utility Class - * This class provides some utility methods - */ -class CCsMsgPluginUtility: public CBase - { - -public: - - /** - * Two phase construction - */ - static CCsMsgPluginUtility* NewL(); - - /** - * Destructor - */ - virtual ~CCsMsgPluginUtility(); - - /** - * Creates CCsConversationEntry using input parameters - * - * @since S60 - * @param aContact Conatct details - * @param aEnryId Unique Id - * @param aTimeStamp time stamp details - * @param aDir TMsvId of Parent - * @param aDescription description of the body message - * @param aSendState TCsSendState enum value - * @param aMsgAttribs TCsAttribute enum value - * @return CCsConversationEntry object - */ - CCsConversationEntry* CreateConversationEntryL( - const HBufC* aContact, - TMsvId aEnryId, - TInt64 aTimeStamp, - TMsvId aDir, - const HBufC* aDescription, - TCsSendState aSendState, - TCsAttribute aMsgAttribs, - TCsType aCsType) const ; - - /** - * Map the call direction to TCsDirection. - * - * @since S60 - * @param aDir The direction string which needs to be mapped - * @return TCsDirection enum value - */ - TCsDirection MapDirection( TMsvId aDir ) const; - - /** - * Returns the message attributes as a bitmask of TCsAttribute values. - * - * @param aEntry Message entry. - * @return A bitmask of TCsAttribute values. - * @see TCsAttribute - */ - TUint16 GetMsgAttributes( const TMsvEntry& aEntry ); - - /** - * Returns the send status. - * - * @param aContext Message entry. - * @return send status like failed, sent, suspended etc. - * @see TCsSendState - */ - TCsSendState GetSendState( const TMsvEntry& aContext ); - - /** - * Create the Contact (From/To) of the message - * - * @param aSession Message Server session - * @param aEntry Message entry - * @param addressList List from extracted from/to addresses - */ - void CreateContactL( CMsvSession* aSession, - const TMsvEntry& aEntry, - RPointerArray& addressList); - - /** - * Compare previous entry with new entry - * - * @param aOldContext previous Message entry - * @param aNewContext new Message entry - * @param aDir entry folder - * @return ETrue/EFalse for same/different - */ - TBool CompareEntry( const TMsvEntry& aOldContext, - const TMsvEntry& aNewContext, - TMsvId aDir ) const; - - /** - * Extracts name and address from the aMsvAddress - * which is of the form name
- * @param aMsvAddress which is of the form name
- * @param aName extracted name - * @param aAddress extracted address - */ - void NameAndAddress( const TPtrC& aMsvAddress, - TPtrC& aName, - TPtrC& aAddress ); - - /** - * Extract the address part for MMS ignoring the alias - */ - TPtrC PureAddress(const TDesC& aAddress); - -private: - /** - * Constructor - */ - CCsMsgPluginUtility(); - - }; - -#endif // _C_CS_MSG_PLUGIN_UTILITY_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/inc/mcsmsgobserver.h --- a/messagingapp/msgappfw/plugin/inc/mcsmsgobserver.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2007 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: The observer interface which handles the completion of - * reading message entries. - * -*/ - - -#ifndef __M_CS_MSG_OBSERVER__ -#define __M_CS_MSG_OBSERVER__ - -// INCLUDE FILES -#include "ccsdefs.h" - -// FORWARD DECLARATION -class CCsConversationEntry; - -// CLASS DECLARATION -/** - * MCsMsgObserver - * Mixin class. - * Observer which handles message read completion. - */ -class MCsMsgObserver - { -public: - /** - * HandleConverastions. - * Handle Conversation event from Plugins - * - * @param aConversationEntryLists List of conversation entries. - */ - virtual void HandleReadCompleteL(const RPointerArray *aConversationEntryLists) = 0; - - /** - * HandleUpdateCompleteL - * Sends the CCsConversationEntry array to Conversation Server - * @param aConversationEntryLists The object to be used to handle updates - * from the plugin - */ - virtual void HandleUpdateCompleteL( const RPointerArray *aConversationEntryLists) = 0; - - /** - * HandleDeleteCompleteL - * Sends the CCsConversationEntry array to Conversation Server - * @param aConversationEntryLists The object to be used to handle updates - * from the plugin - */ - virtual void HandleDeleteCompleteL( const RPointerArray *aConversationEntryLists) = 0; - - /** - * HandleRefreshCompleteL - * Notify conversation server to refresh the conversations from this plugin. - */ - virtual void HandleRefreshCompleteL() = 0; - - /** - * HandleCachingCompleted - * Sends the cache completed status to server - */ - virtual void HandleCachingCompleted() = 0; - - /** - * HandleCachingError - * Sends the error occured during the caching to server - */ - virtual void HandleCachingError(const TInt aError) = 0; - - }; - -#endif // __M_CS_MSG_OBSERVER__ - -// End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/plugin.pro --- a/messagingapp/msgappfw/plugin/plugin.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: -# - -TEMPLATE = subdirs - -QT -= gui - -# Platforms -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -# Build.inf rules - -symbian { - BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ - "./rom/csmsg.iby CORE_APP_LAYER_IBY_EXPORT_PATH(csmsg.iby)" -} - -symbian { -BLD_INF_RULES.prj_mmpfiles = "./group/csmsg.mmp" -} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/rom/csmsg.iby --- a/messagingapp/msgappfw/plugin/rom/csmsg.iby Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +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 __CSMSG_IBY__ -#define __CSMSG_IBY__ - -ECOM_PLUGIN(csmsg.dll, csmsg.rsc) - -// csmsg plugin resource -data=DATAZ_\RESOURCE_FILES_DIR\plugins\csmsg.rsc RESOURCE_FILES_DIR\plugins\csmsg.rsc - - -#endif // __CSMSG_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/rss/csmsg.rss --- a/messagingapp/msgappfw/plugin/rss/csmsg.rss Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2007 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 - -RESOURCE REGISTRY_INFO theInfo -{ - // UID for the DLL - dll_uid = 0x2002A546; - - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - - // UID of interface that is implemented - interface_uid = 0x2002A545; - - implementations = - { - - // Info for all implementations - IMPLEMENTATION_INFO - { - implementation_uid = 0x2002A5B7; - version_no = 1; - display_name = "Message Plugin"; - default_data = "CS Plugin"; - opaque_data = ""; - } - - }; - } - }; -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/src/ccsmsg.cpp --- a/messagingapp/msgappfw/plugin/src/ccsmsg.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2007 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: CS Message Plugin main class - * -*/ - - -// SYSTEM INCLUDES -#include - -// USER INCLUDES -#include "ccsmsg.h" -#include "ccsmsghandler.h" - -// ============================== MEMBER FUNCTIONS ============================ -// ---------------------------------------------------------------------------- -// CCsMsg::NewL -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -CCsMsg* CCsMsg::NewL(MCsPluginEventObserver* aObserver) - { - PRINT ( _L("Enter CCsMsg::NewL") ); - - CCsMsg* self = new ( ELeave ) CCsMsg(aObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - PRINT ( _L("End CCsMsg::NewL") ); - - return self; - } - -// ---------------------------------------------------------------------------- -// CCsMsg::CCsMsg -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -CCsMsg::CCsMsg(MCsPluginEventObserver* aObserver):iPluginEventObserver (aObserver) - { - } - -// ---------------------------------------------------------------------------- -// CCsMsg::ConstructL -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -void CCsMsg::ConstructL() - { - PRINT ( _L("Enter CCsMsg::ConstructL") ); - iMsgHandler=CCsMsgHandler::NewL(this); - PRINT ( _L("Exit CCsMsg::ConstructL") ); - } -// ---------------------------------------------------------------------------- -// CCsMsg::~CCsMsg -// Destructor -// ---------------------------------------------------------------------------- -// -CCsMsg::~CCsMsg() - { - PRINT ( _L("Enter CCsMsg::~CCsMsg") ); - - if(iMsgHandler) - delete iMsgHandler; - iMsgHandler = NULL; - - PRINT ( _L("End CCsMsg::~CCsMsg") ); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleReadCompleteL() -// Sends the CCsConversationEntry array to Conversation Server -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleReadCompleteL( const RPointerArray -*aConversationEntryLists) - { - iPluginEventObserver->AddConversations( *aConversationEntryLists ); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleUpdateCompleteL() -// Sends the CCsConversationEntry array to Conversation Server -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleUpdateCompleteL( const RPointerArray -*aConversationEntryLists) - { - iPluginEventObserver->ModifyConversations( *aConversationEntryLists ); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleDeleteCompleteL() -// Sends the CCsConversationEntry array to Conversation Server -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleDeleteCompleteL( const RPointerArray -*aConversationEntryLists) - { - iPluginEventObserver->DeleteConversations( *aConversationEntryLists ); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleCachingCompleted -// Sends the cache completed status to server -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleCachingCompleted() - { - iPluginEventObserver->CachingCompleted(); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleCachingError -// Sends the error occured during the caching to server -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleCachingError(const TInt aError) - { - iPluginEventObserver->CachingError(aError); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::GetConversationsL() -// This function starts the state machine to fetch msg data from msvserver -// ----------------------------------------------------------------------------- -// -void CCsMsg::GetConversationsL() - { - PRINT ( _L("Enter CCsMsg::GetConversationsL") ); - //start handler - iMsgHandler->StartL(); - } - -// ----------------------------------------------------------------------------- -// CCsMsg::HandleRefreshCompleteL -// Notify server to refresh conversations. -// ----------------------------------------------------------------------------- -// -void CCsMsg::HandleRefreshCompleteL() - { - iPluginEventObserver->RefreshConversations(); - } - -// End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/src/ccsmsghandler.cpp --- a/messagingapp/msgappfw/plugin/src/ccsmsghandler.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,836 +0,0 @@ -/* -* Copyright (c) 2007 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: CS Message Handler, This class caches the conversation server - * with the message data and also sends run-time updates to the - * server with the message data - * -*/ - - -// USER INCLUDES -#include "ccsmsghandler.h" -#include "msgbiouids.h" - -// SYSTEM INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include // For services messages -#include - - -//CONSTANTS -const TInt KMessageArrayGranularity = 50; - -// NOTE:- DRAFT ENTRIES ARE NOT HANDLED IN THE PLUGIN - -// ============================== MEMBER FUNCTIONS ============================ -// ---------------------------------------------------------------------------- -// CCsMsgHandler::NewL -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -CCsMsgHandler* CCsMsgHandler::NewL(MCsMsgObserver *aMsgObserver) - { - PRINT ( _L("Enter CCsMsgHandler::NewL") ); - - CCsMsgHandler* self = new ( ELeave ) CCsMsgHandler(); - CleanupStack::PushL( self ); - self->ConstructL(aMsgObserver); - CleanupStack::Pop( self ); - - PRINT ( _L("End CCsMsgHandler::NewL") ); - - return self; - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::~CCsMsgHandler -// Destructor -// ---------------------------------------------------------------------------- -// -CCsMsgHandler::~CCsMsgHandler() - { - PRINT ( _L("Enter CCsMsgHandler::~CCsMsgHandler") ); - - if(iMsgPluginUtility) - { - delete iMsgPluginUtility; - iMsgPluginUtility = NULL; - } - - if(iConverstationEntryList) - { - iConverstationEntryList->ResetAndDestroy(); - iConverstationEntryList->Close(); - delete iConverstationEntryList; - iConverstationEntryList = NULL; - } - - if(iSmsMtm) - { - delete iSmsMtm; - iSmsMtm = NULL; - } - - if(iMmsMtm) - { - delete iMmsMtm; - iMmsMtm = NULL; - } - - if(iMtmRegistry) - { - delete iMtmRegistry; - iMtmRegistry = NULL; - } - - if(iSession) - { - delete iSession; - iSession = NULL; - } - - if ( iRootEntry ) - { - delete iRootEntry; - iRootEntry = NULL; - } - - if ( iMessages ) - { - iMessages->Reset(); - delete iMessages; - iMessages = NULL; - } - - if(iMessageArray) - { - iMessageArray->Reset(); - iMessageArray->Close(); - delete iMessageArray; - iMessageArray = NULL; - } - - PRINT ( _L("End CCsMsgHandler::~CCsMsgHandler") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::ConstructL -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -void CCsMsgHandler::ConstructL(MCsMsgObserver *aMsgObserver) - { - PRINT ( _L("Enter CCsMsgHandler::ConstructL") ); - - iMsgObserver = aMsgObserver; - - iSession = CMsvSession::OpenSyncL(*this); - - iMsgPluginUtility = CCsMsgPluginUtility::NewL(); - - iConverstationEntryList = new(ELeave)RPointerArray(); - - iMtmRegistry = CClientMtmRegistry::NewL( *iSession ); - - iSmsMtm = static_cast( iMtmRegistry-> - NewMtmL( KSenduiMtmSmsUid ) ); - - iMmsMtm = static_cast( iMtmRegistry-> - NewMtmL( KSenduiMtmMmsUid ) ); - - iState = EReadInbox; - - iMessageArray = new (ELeave)RArray (KMessageArrayGranularity); - - iMessageCount = 0; - - PRINT ( _L("End CCsMsgHandler::ConstructL") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::CCsMsgHandler -// Two Phase Construction -// ---------------------------------------------------------------------------- -// -CCsMsgHandler::CCsMsgHandler() - { - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::ProcessResultsL() -// ProcessResultsL fetches results for the searchsort query and -// updates the CCsServer with the fetched data -// ----------------------------------------------------------------------------- -// -void CCsMsgHandler::ProcessResultsL(TMsvEntry entry) - { - PRINT ( _L("Enter CCsMsgHandler::ProcessResultsL")); - - // Cleanup the conversationEntry List initially. - // So that the previous entries not cleaned up in - // the event of Leave have been clean up. - iConverstationEntryList->ResetAndDestroy(); - - RPointerArray addressList; - - // Ignore hidden items during upload - if ( entry.Visible() == EFalse ) - { - return; - } - - if ( entry.Parent() == KMsvGlobalInBoxIndexEntryIdValue || - entry.Parent() == KMsvSentEntryIdValue || - entry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) - { - iMsgPluginUtility->CreateContactL(iSession, entry, addressList); - - //process entry - ExtractAddressesL(entry, ERead, addressList); - - addressList.ResetAndDestroy(); - } - - PRINT ( _L("Exit CCsMsgHandler::ProcessResultsL") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::HandleSessionEventL -// Implemented for MMsvSessionObserver -// ---------------------------------------------------------------------------- -// -void CCsMsgHandler::HandleSessionEventL( TMsvSessionEvent aEvent, - TAny* aArg1, - TAny* aArg2, - TAny* /*aArg3*/) - { - PRINT1 ( _L("Enter CCsMsgHandler::HandleSessionEventL aEvent=%d"),aEvent ); - - CMsvEntrySelection* selection=NULL; - TMsvId parent; - - //args - if(aArg1 == NULL || aArg2 == NULL) - { - PRINT ( _L("Enter CCsMsgHandler::HandleSessionEventL arguments invalid")); - return; - } - - //start, processing the event - selection= (CMsvEntrySelection*)aArg1; - parent = *(TMsvId*)aArg2; - - // Cleanup the conversationEntry List initially. - iConverstationEntryList->ResetAndDestroy(); - - switch( aEvent ) - { - case EMsvEntriesChanged: - case EMsvEntriesMoved: - { - HandleEventL(selection,parent); - } - break; - - case EMsvEntriesDeleted: - { - if ( parent == KMsvGlobalInBoxIndexEntryIdValue || - parent == KMsvSentEntryIdValue || - parent == KMsvGlobalOutBoxIndexEntryIdValue) - { - for( TInt i=0 ; i < selection->Count() ; i++ ) - { - TMsvId id = selection->At( i ); - - //use utility to create conversation entry - CCsConversationEntry *conversationEntry = - iMsgPluginUtility->CreateConversationEntryL( - NULL, - id, - 0, - parent, - NULL, - ECsSendStateUnknown, - ECsAttributeNone, - 0); - CleanupStack::PushL(conversationEntry); - iConverstationEntryList->AppendL( conversationEntry ); - CleanupStack::Pop(conversationEntry); - - // call observer interface for each entry - iMsgObserver->HandleDeleteCompleteL(iConverstationEntryList); - - //cleanup before next iteration - iConverstationEntryList->ResetAndDestroy(); - } - } - } - break; - - case EMsvMediaChanged: - iMsgObserver->HandleRefreshCompleteL(); - break; - } - - // Cleanup the conversationEntry List before function exits. - iConverstationEntryList->ResetAndDestroy(); - PRINT ( _L("Exit CCsMsgHandler::HandleSessionEventL") ); - } - -// --------------------------------------------------------------------- -// CCsMsgHandler::HandleEvent -// Handle events -// --------------------------------------------------------------------- -// -void CCsMsgHandler::HandleEventL(CMsvEntrySelection* aSelection, TMsvId aParent) - { - PRINT ( _L("Enter CCsMsgHandler::HandleEvent") ); - TMsvEntry entry; - TMsvId service; - TInt error= KErrNone; - RPointerArray addressList; - - for( TInt i=0 ; i < aSelection->Count() ; i++ ) - { - error = iSession->GetEntry(aSelection->At(i),service,entry); - - if ( entry.Visible() == EFalse ) - { - // Do a delete if entry becomes invisible. - // e.g) My Nokia registration messages. - RPointerArray* hiddenEntries = - new (ELeave) RPointerArray(); - - CCsConversationEntry *conversationEntry = - iMsgPluginUtility->CreateConversationEntryL ( - NULL, - entry.Id(), - 0, - aParent, - NULL, - ECsSendStateUnknown, - ECsAttributeNone, - 0 ); - CleanupStack::PushL(conversationEntry); - hiddenEntries->AppendL( conversationEntry ); - CleanupStack::Pop(conversationEntry); - - // Delete at server - iMsgObserver->HandleDeleteCompleteL(hiddenEntries); - hiddenEntries->ResetAndDestroy(); - hiddenEntries->Close(); - delete hiddenEntries; - - break; - } - - if ( (KErrNone == error) && (IsMtmSupported(entry.iMtm.iUid) ) ) - { - // sent/inbox/Outbox entry - if ( aParent == KMsvSentEntryIdValue || - aParent == KMsvGlobalInBoxIndexEntryIdValue ) - { - // currently server needs number, so getting it from header - iMsgPluginUtility->CreateContactL(iSession, entry, - addressList); - - //process entry - // entry created in sent already exists, hence an update - ExtractAddressesL(entry, EUpdate, addressList); - - addressList.ResetAndDestroy(); - } - - //for drafts and outbox, the entry changes multiple times, - // so making a check if entry has changed - else if(aParent == KMsvGlobalOutBoxIndexEntryIdValue) - { - //outbox - if(!(iMsgPluginUtility->CompareEntry(iPrevEntry,entry,aParent))) - { - TUint sendState = entry.SendingState(); - - // if the entry state is sent, we dont need to process it - // as it is going to appear in sent items - if( ECsSendStateSent != iMsgPluginUtility->GetSendState(entry) ) - { - // currently server needs number, so getting it from header - iMsgPluginUtility->CreateContactL(iSession, entry, - addressList); - - //process entry - // entry created in sent already exists, hence an update - ExtractAddressesL(entry, EUpdate, addressList); - - iPrevEntry = entry; - - addressList.ResetAndDestroy(); - } - }//end check changed entry - } - } - }//end for loop - - PRINT ( _L("Exit CCsMsgHandler::HandleEvent") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::CreateAndAddEntryL -// Creates CCsConversationEntry and adds to the list -// ---------------------------------------------------------------------------- -// -void CCsMsgHandler::CreateAndAddEntryL(const TDesC& aContact, - const TDesC& aDescription, - const TMsvEntry& aEntry) - { - PRINT ( _L("Enter CCsMsgHandler::CreateAndAddEntryL") ); - - HBufC* contact = NULL; - HBufC* sDescription = NULL; - - if (aContact.Length()>0) - { - contact = aContact.AllocL(); - CleanupStack::PushL(contact); - } - if (aDescription.Length()>0) - { - sDescription = aDescription.AllocL(); - CleanupStack::PushL(sDescription); - } - - //use utility to create conversation entry - CCsConversationEntry *conversationEntry = iMsgPluginUtility->CreateConversationEntryL( - contact, - aEntry.Id(), - aEntry.iDate.Int64(), - aEntry.Parent(), - sDescription, - iMsgPluginUtility->GetSendState(aEntry), - iMsgPluginUtility->GetMsgAttributes(aEntry), - ExtractCsType(aEntry)); - CleanupStack::PushL(conversationEntry); - - //add to the list - iConverstationEntryList->AppendL( conversationEntry ); - CleanupStack::Pop(conversationEntry); - - // cleanup - if (sDescription) - { - CleanupStack::PopAndDestroy(sDescription); - } - if (contact) - { - CleanupStack::PopAndDestroy(contact); - } - - PRINT ( _L("Exit CCsMsgHandler::CreateAndAddEntryL") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::ProcessEntryL -// Creates CCsConversationEntry and adds to the list -// ---------------------------------------------------------------------------- -// -void CCsMsgHandler::ProcessEntryL( TEventType aEvent, const TDesC& aContact, - const TDesC& aDescription, const TMsvEntry& aEntry) - { - PRINT ( _L("Enter CCsMsgHandler::ProcessEntryL") ); - - // create and add entry to the list - CreateAndAddEntryL(aContact,aDescription,aEntry); - - // call cs observer interface for each entry - switch(aEvent) - { - case ERead: - { - iMsgObserver->HandleReadCompleteL(iConverstationEntryList); - } - break; - case EUpdate: - { - iMsgObserver->HandleUpdateCompleteL(iConverstationEntryList); - } - break; - } - - // Cleanup the conversationEntry List, as we are just sending one entry at a time - iConverstationEntryList->ResetAndDestroy(); - - PRINT ( _L("Exit CCsMsgHandler::ProcessEntryL") ); - } - -// ---------------------------------------------------------------------------- -// CCsMsgHandler::ExtractAddressL -// Extracts the addresses in the to field and updates them to server -// ---------------------------------------------------------------------------- -// -void CCsMsgHandler::ExtractAddressesL( - TMsvEntry aEntry, - TEventType aEvent, - RPointerArray& addressList ) - { - PRINT ( _L("Enter CCsMsgHandler::ExtractAddressesL") ); - - // For SMS read the whole body. - // For bio type SMS read the iDescription - // For other message types read the iDescription - // Note: After the LoadMessageL() the iDescription is getting - // deleted so need to make a copy before that. - TPtrC description; - HBufC* tmpBuffer = NULL; - - if ( (aEntry.iBioType && - aEntry.iBioType != KUidMsgSubTypeMmsAudioMsg.iUid ) || - aEntry.iMtm == KSenduiMtmBtUid ) - { - tmpBuffer = aEntry.iDescription.AllocL(); - description.Set( tmpBuffer->Des() ); - } - else if ( aEntry.iMtm == KSenduiMtmSmsUid ) - { - iSmsMtm->SwitchCurrentEntryL( aEntry.Id() ); - iSmsMtm->LoadMessageL(); - - CRichText& body = iSmsMtm->Body(); - TInt smsLength = body.DocumentLength(); - tmpBuffer = HBufC::NewL(smsLength); - TPtr ptr(tmpBuffer->Des()); - body.Extract(ptr, 0); - description.Set( tmpBuffer->Des() ); - } - else if ( aEntry.iMtm == KSenduiMtmMmsUid || - aEntry.iMtm == KSenduiMMSNotificationUid) - { - tmpBuffer = aEntry.iDescription.AllocL(); - description.Set( tmpBuffer->Des() ); - - iMmsMtm->SwitchCurrentEntryL( aEntry.Id() ); - iMmsMtm->LoadMessageL(); - - // Handle addresses - if ( aEntry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) - { - HBufC* address = iMmsMtm->Sender().AllocL(); - addressList.Append(address); - } - else if ( aEntry.Parent() == KMsvSentEntryIdValue || - aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) - { - const CMsvRecipientList& addresses = iMmsMtm->AddresseeList(); - TInt count = addresses.Count(); - - for( TInt i = 0; i < count; i++) - { - HBufC* address = addresses[i].AllocL(); - TPtrC pureAddress = iMsgPluginUtility->PureAddress(*address); - HBufC* address1 = pureAddress.AllocL(); - addressList.Append(address1); - delete address; - } - } - } - else - { - return; - } - - if ( addressList.Count() > 0 ) - { - for ( int i = 0; i < addressList.Count(); i++ ) - { - HBufC* address = addressList[i]; - ProcessEntryL(aEvent, *address, description, aEntry); - } - } - else - { - // Unknown - ProcessEntryL(aEvent, KNullDesC, description, aEntry); - } - - delete tmpBuffer; - - PRINT ( _L("Exit CCsMsgHandler::ExtractAddressesL") ); - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::CompareOrder() -// Method for determining the sorting behaviour of RArray of TMsvId's -// ----------------------------------------------------------------------------- -// -static TInt CompareOrder(const TMsvId& aFirst, const TMsvId& aSecond) - { - return aSecond - aFirst; - } -// ----------------------------------------------------------------------------- -// CCsMsgHandler::UploadMsgL() -// State machine to upload all messages -// ----------------------------------------------------------------------------- -// -TInt CCsMsgHandler::UploadMsgL() -{ - switch ( iState ) - { - case EReadInbox: - { - iRootEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId); - - // Set sort order - TMsvSelectionOrdering order; - order.SetSorting(EMsvSortById); - iRootEntry->SetSortTypeL(order); - - iMessages = iRootEntry->ChildrenL(); - iMessageCount = iRootEntry->Count(); - if(iMessageCount) - { - for(int i = 0; i < iMessageCount; i ++) - { - iMessageArray->Append(iMessages->At(i)); - } - } - - iState = EReadSent; - CleanupL(); - - return 1; - } - - case EReadSent: - { - iRootEntry = iSession->GetEntryL(KMsvSentEntryId); - - // Set sort order - TMsvSelectionOrdering order; - order.SetSorting(EMsvSortById); - iRootEntry->SetSortTypeL(order); - - iMessages = iRootEntry->ChildrenL(); - iMessageCount = iRootEntry->Count(); - if(iMessageCount) - { - for(int i = 0; i < iMessageCount; i++ ) - { - iMessageArray->Append(iMessages->At(i)); - } - } - - iState = EReadOutbox; - CleanupL(); - - return 1; - } - - case EReadOutbox: - { - iRootEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId); - - // Set sort order - TMsvSelectionOrdering order; - order.SetSorting(EMsvSortById); - iRootEntry->SetSortTypeL(order); - - iMessages = iRootEntry->ChildrenL(); - iMessageCount = iRootEntry->Count(); - - if(iMessageCount) - { - for(int i = 0; i < iMessageCount; i ++) - { - iMessageArray->Append(iMessages->At(i)); - } - iMessageCount=0; - } - iState = ESortEntries; - CleanupL(); - - return 1; - } - case ESortEntries: - { - //Sort the elements in the array by descending order of TMsvId's - TLinearOrder order(CompareOrder); - iMessageArray->Sort(order); - iState = EProcessEntries; - return 1; - } - - case EProcessEntries: - { - //Process one entry at a time in sequence - //Process the first element in the array on each call, till the end - if(iMessageArray->Count()) - { - ProcessResultsL(iSession->GetEntryL(iMessageArray->operator[](0))->Entry()); - iMessageArray->Remove(0); - } - else - { - iMsgObserver->HandleCachingCompleted(); - return 0; //DONE - } - - iState = EProcessEntries; - return 1; - } - } - return 0; -} - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::UploadMsg() -// CIdle callback -// ----------------------------------------------------------------------------- -// -TInt CCsMsgHandler::UploadMsg(TAny* aArg) - { - CCsMsgHandler* handler = (CCsMsgHandler*) aArg; - TInt ok = 0; - TRAPD(err, ok = handler->UploadMsgL()); - return ((err == KErrNone) && ok); - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::StartL() -// This function starts the state machine to fetch sms data from msvserver -// ----------------------------------------------------------------------------- -// -void CCsMsgHandler::StartL() - { - PRINT ( _L("Enter CCsMsgHandler::Start") ); - - iState = EReadInbox; - TCallBack callback = TCallBack(UploadMsg, (TAny*) this); - iIdle = CIdle::NewL(CActive::EPriorityLow); - iIdle->Start(callback); - - PRINT ( _L("End CCsMsgHandler::Start") ); - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::CleanupL() -// Helper function for state machine cleanup -// ----------------------------------------------------------------------------- -// -void CCsMsgHandler::CleanupL() - { - if ( iRootEntry ) - { - delete iRootEntry; - iRootEntry = NULL; - } - - if ( iMessages ) - { - iMessages->Reset(); - delete iMessages; - iMessages = NULL; - } - - iMessageCount = 0; - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::IsMtmSupported() -// -// ----------------------------------------------------------------------------- -// -TBool CCsMsgHandler::IsMtmSupported(long uid) - { - if ( KSenduiMtmSmsUidValue == uid || \ - KSenduiMtmBtUidValue == uid || \ - KSenduiMtmMmsUidValue == uid || \ - KSenduiMtmBioUidValue == uid || \ - KSenduiMMSNotificationUidValue == uid || \ - KUidMtmWapPush == TUid::Uid(uid) ) - { - return ETrue; - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CCsMsgHandler::ExtractCsType() -// Extracts the Message type based on the MTM Uid -// ----------------------------------------------------------------------------- -// -TCsType CCsMsgHandler::ExtractCsType( const TMsvEntry& aEntry) - { - TCsType type = ECsUnknown; - switch(aEntry.iMtm.iUid) - { - case KSenduiMtmSmsUidValue: - type = ECsSMS; - if (aEntry.iBioType == KMsgBioUidVCard.iUid) - { - type = ECsBioMsg_VCard; - } - break; - case KSenduiMtmBtUidValue: - type = ECsBlueTooth; - break; - case KSenduiMtmMmsUidValue: - if(aEntry.iBioType == KUidMsgSubTypeMmsAudioMsg.iUid) - { - type = ECsAudio; - } - else - { - type = ECsMMS; - } - break; - case KSenduiMMSNotificationUidValue: - type = ECsMmsNotification; - break; - case KSenduiMtmBioUidValue: - { - type = ECsBioMsg; - - // based on the biotype uid set message type - if(aEntry.iBioType == KMsgBioUidRingingTone.iUid) - { - type = ECsRingingTone; - } - else if(aEntry.iBioType == KMsgBioProvisioningMessage.iUid) - { - type = ECsProvisioning; - } - else if (aEntry.iBioType == KMsgBioUidVCard.iUid) - { - type = ECsBioMsg_VCard; - } - else if (aEntry.iBioType == KMsgBioUidVCalendar.iUid) - { - type = ECsBioMsg_VCal; - } - } - break; - default: - type = ECsUnknown; - break; - } - return (type); - } -// End of file - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/src/ccsmsgpluginutility.cpp --- a/messagingapp/msgappfw/plugin/src/ccsmsgpluginutility.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,462 +0,0 @@ -/* -* Copyright (c) 2007 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: CS Msg Plugin Utility class - * -*/ - - -// USER INCLUDES -#include "ccsmsgpluginutility.h" -#include "ccsdebug.h" - -//SYSTEM INCLUDES -#include -#include -#include -#include -#include - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::NewL -// Two Phase Construction -// ---------------------------------------------------------------------------- -CCsMsgPluginUtility* CCsMsgPluginUtility::NewL( ) - { - CCsMsgPluginUtility* self = new ( ELeave ) CCsMsgPluginUtility(); - return self; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::~CCsMsgPluginUtility -// Destructor -// ---------------------------------------------------------------------------- -CCsMsgPluginUtility::~CCsMsgPluginUtility() - { - } - -// ---------------------------------------------------------------------------- -// Constructor -// ---------------------------------------------------------------------------- -CCsMsgPluginUtility::CCsMsgPluginUtility() - { - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::CreateConversationEntryL -// Creates CCsConversationEntry -// ---------------------------------------------------------------------------- -// -CCsConversationEntry* CCsMsgPluginUtility::CreateConversationEntryL( - const HBufC* aContact, - TMsvId aEnryId, - TInt64 aTimeStamp, - TMsvId aDir, - const HBufC* aDescription, - TCsSendState aSendState, - TCsAttribute aMsgAttribs, - TCsType aCsType) const - { - // create CCsConversationEntry - CCsConversationEntry *conversationEntry = CCsConversationEntry::NewL(); - CleanupStack::PushL(conversationEntry); - - //set the values - conversationEntry->SetContactL( *aContact ); - conversationEntry->SetEntryId( aEnryId ); - conversationEntry->SetTimeStampL( aTimeStamp ); - conversationEntry->SetDescriptionL( *aDescription ); - conversationEntry->SetConversationDir( MapDirection( aDir ) ); - conversationEntry->SetSendState( aSendState ); - conversationEntry->ChangeAttributes( aMsgAttribs, ECsAttributeNone ); - conversationEntry->SetType(aCsType); - - //pop and return - CleanupStack::Pop(conversationEntry); - return conversationEntry; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::MapDirection -// Map the msg direction to TCsDirection -// ---------------------------------------------------------------------------- -// -TCsDirection CCsMsgPluginUtility::MapDirection( TMsvId aDir ) const - { - TCsDirection direction = ECsDirectionUnknown; - switch(aDir) - { - case KMsvSentEntryIdValue: - case KMsvGlobalOutBoxIndexEntryIdValue: // Fall-through - case KMsvDraftEntryIdValue: - { - direction = ECsDirectionOutgoing; - break; - } - case KMsvGlobalInBoxIndexEntryIdValue: - { - direction = ECsDirectionIncoming; - break; - } - } - return direction; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::GetMsgAttributes -// Returns the message attributes as a bitmask of TCsAttribute values. -// ---------------------------------------------------------------------------- -// -TUint16 CCsMsgPluginUtility::GetMsgAttributes( const TMsvEntry& aEntry ) - { - TUint16 msgAttributes = ECsAttributeNone; - TMsvId parent = aEntry.Parent(); - - // New - if( aEntry.New() ) - { - msgAttributes |= ECsAttributeNew; - } - - // Drafts - if( KMsvDraftEntryIdValue == parent ) - { - msgAttributes |= ECsAttributeDraft; - } - - // Attachments - if( aEntry.Attachment() ) - { - msgAttributes |= ECsAttributeAttachment; - } - - // Priority - TMsvPriority priority = aEntry.Priority(); - if( EMsvHighPriority == priority ) - { - msgAttributes |= ECsAttributeHighPriority; - } - else if( EMsvLowPriority == priority ) - { - msgAttributes |= ECsAttributeLowPriority; - } - - // Read/Unread - if( KMsvGlobalInBoxIndexEntryIdValue == parent ) - { - if( EFalse == aEntry.Unread() ) - { - // Read - msgAttributes &= ~ECsAttributeUnread; - } - else - { - // Unread - msgAttributes |= ECsAttributeUnread; - } - } - - // Sent - if( KMsvSentEntryIdValue == parent ) - { - msgAttributes |= ECsAttributeSent; - } - - return msgAttributes; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::GetSendState -// Returns the send status. -// ---------------------------------------------------------------------------- -// -TCsSendState CCsMsgPluginUtility::GetSendState( const TMsvEntry& aContext ) - { - TUint sendingState = aContext.SendingState(); - TCsSendState convSendState = ECsSendStateUnknown; - - switch( sendingState ) - { - case KMsvSendStateUponRequest: - { - convSendState = ECsSendStateUponRequest; - break; - } - case KMsvSendStateWaiting: - { - convSendState = ECsSendStateWaiting; - break; - } - case KMsvSendStateSending: - { - convSendState = ECsSendStateSending; - break; - } - case KMsvSendStateScheduled: - { - convSendState = ECsSendStateScheduled; - break; - } - case KMsvSendStateResend: - { - convSendState = ECsSendStateResend; - break; - } - case KMsvSendStateSuspended: - { - convSendState = ECsSendStateSuspended; - break; - } - case KMsvSendStateFailed: - { - convSendState = ECsSendStateFailed; - break; - } - case KMsvSendStateSent: - { - convSendState = ECsSendStateSent; - break; - } - case KMsvSendStateNotApplicable: - { - convSendState = ECsSendStateNotApplicable; - break; - } - } - return convSendState; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::GetContact -// Get the Contact (From/To) of the message -// ---------------------------------------------------------------------------- -// -void CCsMsgPluginUtility::CreateContactL(CMsvSession* aSession, - const TMsvEntry& aEntry, - RPointerArray& addressList) - { - if ( aEntry.iMtm.iUid == KSenduiMtmSmsUidValue ) - { - CPlainText* nullString = CPlainText::NewL(); - CleanupStack::PushL( nullString ); - - CSmsHeader* smsHeader = NULL; - if ( aEntry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) - { - smsHeader = CSmsHeader::NewL( CSmsPDU::ESmsDeliver, *nullString ); - } - else if ( aEntry.Parent() == KMsvSentEntryIdValue || - aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) - { - smsHeader = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *nullString ); - } - else - { - CleanupStack::PopAndDestroy(nullString); - return; - } - CleanupStack::PushL( smsHeader ); - - CMsvEntry *cEntry = CMsvEntry::NewL(*aSession,aEntry.Id(), - TMsvSelectionOrdering() ); - CleanupStack::PushL( cEntry ); - - CMsvStore* store = cEntry->ReadStoreL(); - CleanupStack::PushL(store); - - TRAPD(err, smsHeader->RestoreL( *store )); - if ( err == KErrNone ) - { - if ( aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue || - aEntry.Parent() == KMsvSentEntryIdValue ) - { - const CArrayPtrFlat& rcpts = smsHeader->Recipients(); - const CSmsNumber& rcpt = *rcpts.At(0); - - HBufC* fromAddress = (rcpt.Address()).AllocL(); - addressList.Append(fromAddress); - } - else - { - // Check and add if any email addresses - const CSmsEmailFields& emailFields = smsHeader->EmailFields(); - if( emailFields.HasAddress() ) - { - TPtrC name; - TPtrC address; - - const MDesCArray& emailRecipients = emailFields.Addresses(); - for( TInt id = 0; id < emailRecipients.MdcaCount(); id++ ) - { - NameAndAddress( emailRecipients.MdcaPoint( id ), name, address); - - // Add address to list - HBufC* addressBuf = HBufC::NewL( address.Length() ); - TPtr addressPtr( 0, 0 ); - addressPtr.Set( addressBuf->Des() ); - addressPtr.Copy( address ); - addressList.Append(addressBuf); - } - } - else - { - HBufC* fromAddress = (smsHeader->FromAddress()).AllocL(); - - // Try iDetails if empty - if ( fromAddress->Length() == 0 ) - fromAddress = aEntry.iDetails.AllocL(); - - addressList.Append(fromAddress); - } - } - } - - // Cleanup - CleanupStack::PopAndDestroy(store); - CleanupStack::PopAndDestroy(cEntry); - CleanupStack::PopAndDestroy(smsHeader); - CleanupStack::PopAndDestroy(nullString); - } - else if ( aEntry.iMtm.iUid == KSenduiMtmBtUidValue || - aEntry.iMtm.iUid == KSenduiMtmBioUidValue || - aEntry.iMtm == KUidMtmWapPush ) - { - HBufC* fromAddress = aEntry.iDetails.AllocL(); - addressList.Append(fromAddress); - } - } - -// --------------------------------------------------------- -// CCsMsgPluginUtility::CompareEntry -// -// --------------------------------------------------------- -TBool CCsMsgPluginUtility::CompareEntry( const TMsvEntry& aOldContext, - const TMsvEntry& aNewContext, TMsvId aDir ) const - { - if( (aOldContext.Id() == aNewContext.Id()) - && (aOldContext.Parent() == aNewContext.Parent()) - && (0 == aOldContext.iDescription.Compare(aNewContext.iDescription)) ) - { - // incase of outbox, check sending state also - if(aDir == KMsvGlobalOutBoxIndexEntryIdValue) - { - if(aOldContext.SendingState() == aNewContext.SendingState()) - return ETrue; - else - return EFalse; - } - return ETrue; - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CCsMsgPluginUtility::NameAndAddress -// Extracts name and address from the aMsvAddress -// which is of the form name
-// ---------------------------------------------------------------------------- -void CCsMsgPluginUtility::NameAndAddress( const TPtrC& aMsvAddress, - TPtrC& aName, - TPtrC& aAddress ) - { - // For address information separation (start) - const TUint KMsgSmsAddressStartChar ('<'); - - // For address information separation (end) - const TUint KMsgSmsAddressEndChar ('>'); - - TInt addressStart = aMsvAddress.LocateReverse( KMsgSmsAddressStartChar ); - TInt addressEnd = aMsvAddress.LocateReverse( KMsgSmsAddressEndChar ); - - if ( addressStart != KErrNotFound && addressEnd != KErrNotFound - && addressEnd > addressStart ) - { - // verified address, will be used as selected from contacts manager - aName.Set( aMsvAddress.Ptr(), addressStart ); - aAddress.Set( - aMsvAddress.Mid( addressStart + 1 ).Ptr(), - ( addressEnd - addressStart ) -1 ); - if ( !aAddress.Length()) - { - aAddress.Set( aName ); - aName.Set( KNullDesC ); // empty string - } - } - else - { - // unverified string, will be used as entered in the header field - aName.Set( KNullDesC ); // empty string - aAddress.Set( aMsvAddress.Ptr(), aMsvAddress.Length() ); // a whole string to address - } - - if ( aName.CompareF( aAddress ) == 0 ) - { - aName.Set( KNullDesC ); // empty string - } - } - -// --------------------------------------------------------- -// CCsMsgPluginUtility::PureAddress -// Extract the phone number for MMS -// --------------------------------------------------------- -// -TPtrC CCsMsgPluginUtility::PureAddress( const TDesC& aAddress ) - { - _LIT( KOpen, "<" ); - _LIT( KClose, ">" ); - - // syntax is : - // | - // - TInt firstPos = 0; - TInt lastPos = 0; - TInt length = aAddress.Length(); - TInt sepaLen1 = KOpen().Length(); - TInt sepaLen2 = KClose().Length(); - TInt firstSeparatorPosition = 0; - - while( firstSeparatorPosition >= 0 ) - { - firstSeparatorPosition = aAddress.Mid( firstPos ).Find( KOpen ); - if ( firstSeparatorPosition >= 0 ) - { - firstPos += firstSeparatorPosition + sepaLen1; - } - } - if ( firstPos <= 0 ) - { - // No alias - return aAddress; - } - - // Check if the second separator ends the address - TPtrC last = aAddress.Right( sepaLen2 ); - lastPos = length - sepaLen2; - - if ( !last.Compare( KClose ) ) - { - // Alias part found - if ( lastPos > firstPos ) - { - return aAddress.Mid( firstPos, lastPos - firstPos ); - } - } - // No alias defined - return the original string as pure address - // If syntax is weird, namely - // alias <> - // with nothing between the separators, we return the original string as is - return aAddress; - } - -//End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugin/src/proxy.cpp --- a/messagingapp/msgappfw/plugin/src/proxy.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2007 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: ECOM Plugin proxy details - * -*/ - - -// INCLUDES -#include -#include -#include "ccsmsg.h" - -// Provides a key value pair table, this is used to identify -// the correct construction function for the requested interface. -const TImplementationProxy ImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY(0x2002A5B7, CCsMsg::NewL ) -}; - -// Function used to return an instance of the proxy table. -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// End of file - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/group/csmsg.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/group/csmsg.mmp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2006-2007 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: CS Msg Plugin +* +*/ +#include +#include + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT +TARGET csmsg.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2002A546 + +VERSION 1.0 + +PAGED + +// RESOURCE +START RESOURCE ../rss/csmsg.rss +TARGET csmsg.rsc +END + +SOURCEPATH ../src + +SOURCE proxy.cpp +SOURCE ccsmsg.cpp +SOURCE ccsmsgpluginutility.cpp +SOURCE ccsmsghandler.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../server/inc +USERINCLUDE ../../../utils/inc +USERINCLUDE ../../../../../inc +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eCom.lib +LIBRARY csutils.lib +DEBUGLIBRARY flogger.lib + +// Msg Server +LIBRARY Smcm.lib +LIBRARY gsmu.lib +LIBRARY etext.lib +LIBRARY msgs.lib diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsg.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2007 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: Message Plugin main class + * +*/ + + +#ifndef _C_CS_MSG_H_ +#define _C_CS_MSG_H_ + +// INCLUDE FILES + +// SYSTEM INCLUDES + +// USER INCLUDES +#include "ccsplugin.h" +#include "mcsmsgobserver.h" +#include "ccsdebug.h" +#include "ccsdefs.h" + +// FORWARD DECLARATION +class MCsPluginEventObserver; +class MCsMsgObserver; +class CCsConversationEntry; +class CCsMsgHandler; + +/** + * Message plugin class + * This class interacts with MsvServer to fetch the message data. + */ +class CCsMsg : public CCsPlugin, public MCsMsgObserver + { +public: + + /** + * Two phase construction + */ + static CCsMsg* NewL( MCsPluginEventObserver* aMCsPluginEventObserver); + + /** + * Destructor + */ + virtual ~CCsMsg(); + + +public: // From base class CCsPlugin + /** + * GetConversationsL + * This function starts the state machine to fetch msg data from msvserver + */ + void GetConversationsL(); + +public: //MCsMsgObserver + /** + * HandleReadCompleteL + * Sends the CCsConversationEntry array to Conversation Server + * @param aConversationEntryLists The object to be used to handle updates + * from the plugin + */ + void HandleReadCompleteL( const RPointerArray *aConversationEntryLists); + + /** + * HandleUpdateCompleteL + * Sends the CCsConversationEntry array to Conversation Server + * @param aConversationEntryLists The object to be used to handle updates + * from the plugin + */ + void HandleUpdateCompleteL( const RPointerArray *aConversationEntryLists); + + /** + * HandleDeleteCompleteL + * Sends the CCsConversationEntry array to Conversation Server + * @param aConversationEntryLists The object to be used to handle updates + * from the plugin + */ + void HandleDeleteCompleteL( const RPointerArray *aConversationEntryLists); + + /** + * HandleRefreshCompleteL + * Notify conversation server to refresh the conversations from this plugin. + */ + void HandleRefreshCompleteL(); + + /** + * HandleCachingCompleted + * Sends the cache completed status to server + */ + void HandleCachingCompleted(); + + /** + * HandleCachingError + * Sends the error occured during the caching to server + */ + void HandleCachingError(const TInt aError); + +private: + + /** + * Constructor + */ + CCsMsg(MCsPluginEventObserver* aObserver); + + /** + * 2nd phase construtor + */ + void ConstructL(); + +private: //Data + + /** + * The msg plugin class which sends the initial set of conversation + * entries upon bootup to conversations server. + * and notifies the conversations server about the new MsvServer events + */ + CCsMsgHandler* iMsgHandler; + + /** + * iPluginEventObserver + * Plugin event observer + * Not Own. + */ + MCsPluginEventObserver* iPluginEventObserver; + }; + +#endif // _C_CS_MSG_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsghandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsghandler.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2007 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: Request Handler plugin + * +*/ + + +#ifndef _C_CS_MSG_REQUEST_HANDLER_H_ +#define _C_CS_MSG_REQUEST_HANDLER_H_ + +//SYSTEM INCLUDES +#include + +//USER INCLUDES +#include "ccsmsg.h" +#include "ccsmsgpluginutility.h" + + +// FORWARD DECLARATION +class CCsPlugin; +class CMsvSession; +class MCsPluginEventObserver; +class MMsvSessionObserver; +class CCsConversationEntry; +class CCsMsg; +class CCsMsgPluginUtility; +class CClientMtmRegistry; +class CSmsClientMtm; +class CMmsClientMtm; + +/** + * Operation Type + */ +enum TEventType + { + ERead, + EUpdate, + EDelete + }; + +/** + * States + */ +enum TMsgHandlerState + { + EReadInbox, + EReadSent, + EProcessDraft, + EReadOutbox, + ESortEntries, + EProcessEntries, + EComplete + }; + +/** + * Message plugin Request Handler Class + * This class interacts with MsvServer to fetch message data + */ +class CCsMsgHandler : public CBase, public MMsvSessionObserver + { + +public: + + /** + * Two phase construction + * @param aMsgObserver MCsMsgObserver interface + */ + static CCsMsgHandler* NewL(MCsMsgObserver *aMsgObserver); + + /** + * Destructor + */ + virtual ~CCsMsgHandler(); + + /** + * Start + * This function starts the state machine to fetch msg data from msvserver + */ + void StartL(); + +public://MMsvSessionObserver + /** + * Handles the MsvServer updates. Implemented for MMsvSessionObserver + */ + void HandleSessionEventL(TMsvSessionEvent aEvent, + TAny* aArg1, + TAny* aArg2, + TAny* aArg3); + +private: + + /** + * CIdle callback + */ + static TInt UploadMsg(TAny* arg); + + /** + * State handler to read all messages + */ + TInt UploadMsgL(); + + /** + * Checks if the MTM type supported + */ + TBool IsMtmSupported(long uid); + +private: + + /** + * Constructor + */ + CCsMsgHandler(); + + /** + * 2nd phase construtor + * @param aMsgPlugin The main message plugin object + */ + void ConstructL(MCsMsgObserver *aMsgPlugin); + + /** + * ProcessResultsL fetches results and updates the CCsServer + * with the fetched data + */ + void ProcessResultsL(TMsvEntry aEntry); + + /** + * Create CCsConversationEntry and adds to the list + * @param aContact, Contact details + * @param aDescription, message body + * @param aEntry, TMsvEntry + */ + void CreateAndAddEntryL(const TDesC& aContact, + const TDesC& aDescription, + const TMsvEntry& aEntry); + + /** + * Process each entry + * @param aEvent Read, Update, Delete + * @param aContact (From/To) Field + * @param aDescription, message body + * @param aEntry, Message entry + */ + void ProcessEntryL(TEventType aEvent, + const TDesC& aContact, + const TDesC& aDescription, + const TMsvEntry& aEntry); + + /** + * Process each entry + *@param aSelection, CMsvEntrySelections + *@param aParent, parent id if TMsvEntry + */ + void HandleEventL(CMsvEntrySelection* aSelection, TMsvId aParent); + + /** + * Extracts the addresses in the to field and updates them to server + *@param aEntry, TMsvEntry + *@param aEvent Read, Update, Delete + *@param aFromAddress, from address of the message + */ + void ExtractAddressesL( + TMsvEntry aEntry , + TEventType aEvent, + RPointerArray& addressList); + + /** + * Cleanup + */ + void CleanupL(); + + /** + * Extracts the Message type based on the MTM value + * @param aEntry, TMsvEntry + */ + TCsType ExtractCsType( const TMsvEntry& aEntry); + +private: //Data + + /** + * MsvServer session object + */ + CMsvSession* iSession; + + /** + * Utility object + */ + CCsMsgPluginUtility* iMsgPluginUtility; + + /** + * iConverstationEntryList + * ConversationEntry list + * Own. + */ + RPointerArray *iConverstationEntryList; + + /** + * iMsgObserver + * The Observer interface + * Not Own. + */ + MCsMsgObserver *iMsgObserver; + + /** + * Mtm registry object + */ + CClientMtmRegistry* iMtmRegistry; + + /** + * SMS client mtm object + */ + CSmsClientMtm* iSmsMtm; + + /** + * Mms client mtm object + */ + CMmsClientMtm* iMmsMtm; + + /** + * Previous entry, used for comparing with new entry received + */ + TMsvEntry iPrevEntry; + + /** + * Root entry + */ + CMsvEntry* iRootEntry; + + /** + * Mesage count + */ + TInt iMessageCount; + + /** + * Messages under root entry + */ + CMsvEntrySelection* iMessages; + + /** + * Master array for holding all the messages + */ + RArray* iMessageArray; + + /** + * State + */ + TMsgHandlerState iState; + + /** + * Active object + */ + CIdle* iIdle; + }; + +#endif // _C_CS_MSG_REQUEST_HANDLER_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsgpluginutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/inc/ccsmsgpluginutility.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2007 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: Utility class + * +*/ + + +#ifndef _C_CS_MSG_PLUGIN_UTILITY_H_ +#define _C_CS_MSG_PLUGIN_UTILITY_H_ + +// SYSTEM INCLUDES +#include +#include // CSmsHeader +#include +#include +#include +#include + +// FORWARD DECLARATION +class CCsConversationEntry; + +/** + * Message plugin Utility Class + * This class provides some utility methods + */ +class CCsMsgPluginUtility: public CBase + { + +public: + + /** + * Two phase construction + */ + static CCsMsgPluginUtility* NewL(); + + /** + * Destructor + */ + virtual ~CCsMsgPluginUtility(); + + /** + * Creates CCsConversationEntry using input parameters + * + * @since S60 + * @param aContact Conatct details + * @param aEnryId Unique Id + * @param aTimeStamp time stamp details + * @param aDir TMsvId of Parent + * @param aDescription description of the body message + * @param aSendState TCsSendState enum value + * @param aMsgAttribs TCsAttribute enum value + * @return CCsConversationEntry object + */ + CCsConversationEntry* CreateConversationEntryL( + const HBufC* aContact, + TMsvId aEnryId, + TInt64 aTimeStamp, + TMsvId aDir, + const HBufC* aDescription, + TCsSendState aSendState, + TCsAttribute aMsgAttribs, + TCsType aCsType) const ; + + /** + * Map the call direction to TCsDirection. + * + * @since S60 + * @param aDir The direction string which needs to be mapped + * @return TCsDirection enum value + */ + TCsDirection MapDirection( TMsvId aDir ) const; + + /** + * Returns the message attributes as a bitmask of TCsAttribute values. + * + * @param aEntry Message entry. + * @return A bitmask of TCsAttribute values. + * @see TCsAttribute + */ + TUint16 GetMsgAttributes( const TMsvEntry& aEntry ); + + /** + * Returns the send status. + * + * @param aContext Message entry. + * @return send status like failed, sent, suspended etc. + * @see TCsSendState + */ + TCsSendState GetSendState( const TMsvEntry& aContext ); + + /** + * Create the Contact (From/To) of the message + * + * @param aSession Message Server session + * @param aEntry Message entry + * @param addressList List from extracted from/to addresses + */ + void CreateContactL( CMsvSession* aSession, + const TMsvEntry& aEntry, + RPointerArray& addressList); + + /** + * Compare previous entry with new entry + * + * @param aOldContext previous Message entry + * @param aNewContext new Message entry + * @param aDir entry folder + * @return ETrue/EFalse for same/different + */ + TBool CompareEntry( const TMsvEntry& aOldContext, + const TMsvEntry& aNewContext, + TMsvId aDir ) const; + + /** + * Extracts name and address from the aMsvAddress + * which is of the form name
+ * @param aMsvAddress which is of the form name
+ * @param aName extracted name + * @param aAddress extracted address + */ + void NameAndAddress( const TPtrC& aMsvAddress, + TPtrC& aName, + TPtrC& aAddress ); + + /** + * Extract the address part for MMS ignoring the alias + */ + TPtrC PureAddress(const TDesC& aAddress); + +private: + /** + * Constructor + */ + CCsMsgPluginUtility(); + + }; + +#endif // _C_CS_MSG_PLUGIN_UTILITY_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/inc/mcsmsgobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/inc/mcsmsgobserver.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 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: The observer interface which handles the completion of + * reading message entries. + * +*/ + + +#ifndef __M_CS_MSG_OBSERVER__ +#define __M_CS_MSG_OBSERVER__ + +// INCLUDE FILES +#include "ccsdefs.h" + +// FORWARD DECLARATION +class CCsConversationEntry; + +// CLASS DECLARATION +/** + * MCsMsgObserver + * Mixin class. + * Observer which handles message read completion. + */ +class MCsMsgObserver + { +public: + /** + * HandleConverastions. + * Handle Conversation event from Plugins + * + * @param aConversationEntryLists List of conversation entries. + */ + virtual void HandleReadCompleteL(const RPointerArray *aConversationEntryLists) = 0; + + /** + * HandleUpdateCompleteL + * Sends the CCsConversationEntry array to Conversation Server + * @param aConversationEntryLists The object to be used to handle updates + * from the plugin + */ + virtual void HandleUpdateCompleteL( const RPointerArray *aConversationEntryLists) = 0; + + /** + * HandleDeleteCompleteL + * Sends the CCsConversationEntry array to Conversation Server + * @param aConversationEntryLists The object to be used to handle updates + * from the plugin + */ + virtual void HandleDeleteCompleteL( const RPointerArray *aConversationEntryLists) = 0; + + /** + * HandleRefreshCompleteL + * Notify conversation server to refresh the conversations from this plugin. + */ + virtual void HandleRefreshCompleteL() = 0; + + /** + * HandleCachingCompleted + * Sends the cache completed status to server + */ + virtual void HandleCachingCompleted() = 0; + + /** + * HandleCachingError + * Sends the error occured during the caching to server + */ + virtual void HandleCachingError(const TInt aError) = 0; + + }; + +#endif // __M_CS_MSG_OBSERVER__ + +// End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/msgplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/msgplugin.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +# Platforms +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +# Build.inf rules + +symbian { + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "./rom/csmsg.iby CORE_APP_LAYER_IBY_EXPORT_PATH(csmsg.iby)" +} + +symbian { +BLD_INF_RULES.prj_mmpfiles = "./group/csmsg.mmp" +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/rom/csmsg.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/rom/csmsg.iby Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,26 @@ +/* +* 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 __CSMSG_IBY__ +#define __CSMSG_IBY__ + +ECOM_PLUGIN(csmsg.dll, csmsg.rsc) + +// csmsg plugin resource +data=DATAZ_\RESOURCE_FILES_DIR\plugins\csmsg.rsc RESOURCE_FILES_DIR\plugins\csmsg.rsc + + +#endif // __CSMSG_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/rss/csmsg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/rss/csmsg.rss Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2007 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 + +RESOURCE REGISTRY_INFO theInfo +{ + // UID for the DLL + dll_uid = 0x2002A546; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + + // UID of interface that is implemented + interface_uid = 0x2002A545; + + implementations = + { + + // Info for all implementations + IMPLEMENTATION_INFO + { + implementation_uid = 0x2002A5B7; + version_no = 1; + display_name = "Message Plugin"; + default_data = "CS Plugin"; + opaque_data = ""; + } + + }; + } + }; +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/src/ccsmsg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsg.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2007 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: CS Message Plugin main class + * +*/ + + +// SYSTEM INCLUDES +#include + +// USER INCLUDES +#include "ccsmsg.h" +#include "ccsmsghandler.h" + +// ============================== MEMBER FUNCTIONS ============================ +// ---------------------------------------------------------------------------- +// CCsMsg::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsMsg* CCsMsg::NewL(MCsPluginEventObserver* aObserver) + { + PRINT ( _L("Enter CCsMsg::NewL") ); + + CCsMsg* self = new ( ELeave ) CCsMsg(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + PRINT ( _L("End CCsMsg::NewL") ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CCsMsg::CCsMsg +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsMsg::CCsMsg(MCsPluginEventObserver* aObserver):iPluginEventObserver (aObserver) + { + } + +// ---------------------------------------------------------------------------- +// CCsMsg::ConstructL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +void CCsMsg::ConstructL() + { + PRINT ( _L("Enter CCsMsg::ConstructL") ); + iMsgHandler=CCsMsgHandler::NewL(this); + PRINT ( _L("Exit CCsMsg::ConstructL") ); + } +// ---------------------------------------------------------------------------- +// CCsMsg::~CCsMsg +// Destructor +// ---------------------------------------------------------------------------- +// +CCsMsg::~CCsMsg() + { + PRINT ( _L("Enter CCsMsg::~CCsMsg") ); + + if(iMsgHandler) + delete iMsgHandler; + iMsgHandler = NULL; + + PRINT ( _L("End CCsMsg::~CCsMsg") ); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleReadCompleteL() +// Sends the CCsConversationEntry array to Conversation Server +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleReadCompleteL( const RPointerArray +*aConversationEntryLists) + { + iPluginEventObserver->AddConversations( *aConversationEntryLists ); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleUpdateCompleteL() +// Sends the CCsConversationEntry array to Conversation Server +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleUpdateCompleteL( const RPointerArray +*aConversationEntryLists) + { + iPluginEventObserver->ModifyConversations( *aConversationEntryLists ); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleDeleteCompleteL() +// Sends the CCsConversationEntry array to Conversation Server +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleDeleteCompleteL( const RPointerArray +*aConversationEntryLists) + { + iPluginEventObserver->DeleteConversations( *aConversationEntryLists ); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleCachingCompleted +// Sends the cache completed status to server +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleCachingCompleted() + { + iPluginEventObserver->CachingCompleted(); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleCachingError +// Sends the error occured during the caching to server +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleCachingError(const TInt aError) + { + iPluginEventObserver->CachingError(aError); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::GetConversationsL() +// This function starts the state machine to fetch msg data from msvserver +// ----------------------------------------------------------------------------- +// +void CCsMsg::GetConversationsL() + { + PRINT ( _L("Enter CCsMsg::GetConversationsL") ); + //start handler + iMsgHandler->StartL(); + } + +// ----------------------------------------------------------------------------- +// CCsMsg::HandleRefreshCompleteL +// Notify server to refresh conversations. +// ----------------------------------------------------------------------------- +// +void CCsMsg::HandleRefreshCompleteL() + { + iPluginEventObserver->RefreshConversations(); + } + +// End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,836 @@ +/* +* Copyright (c) 2007 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: CS Message Handler, This class caches the conversation server + * with the message data and also sends run-time updates to the + * server with the message data + * +*/ + + +// USER INCLUDES +#include "ccsmsghandler.h" +#include "msgbiouids.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include // For services messages +#include + + +//CONSTANTS +const TInt KMessageArrayGranularity = 50; + +// NOTE:- DRAFT ENTRIES ARE NOT HANDLED IN THE PLUGIN + +// ============================== MEMBER FUNCTIONS ============================ +// ---------------------------------------------------------------------------- +// CCsMsgHandler::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsMsgHandler* CCsMsgHandler::NewL(MCsMsgObserver *aMsgObserver) + { + PRINT ( _L("Enter CCsMsgHandler::NewL") ); + + CCsMsgHandler* self = new ( ELeave ) CCsMsgHandler(); + CleanupStack::PushL( self ); + self->ConstructL(aMsgObserver); + CleanupStack::Pop( self ); + + PRINT ( _L("End CCsMsgHandler::NewL") ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::~CCsMsgHandler +// Destructor +// ---------------------------------------------------------------------------- +// +CCsMsgHandler::~CCsMsgHandler() + { + PRINT ( _L("Enter CCsMsgHandler::~CCsMsgHandler") ); + + if(iMsgPluginUtility) + { + delete iMsgPluginUtility; + iMsgPluginUtility = NULL; + } + + if(iConverstationEntryList) + { + iConverstationEntryList->ResetAndDestroy(); + iConverstationEntryList->Close(); + delete iConverstationEntryList; + iConverstationEntryList = NULL; + } + + if(iSmsMtm) + { + delete iSmsMtm; + iSmsMtm = NULL; + } + + if(iMmsMtm) + { + delete iMmsMtm; + iMmsMtm = NULL; + } + + if(iMtmRegistry) + { + delete iMtmRegistry; + iMtmRegistry = NULL; + } + + if(iSession) + { + delete iSession; + iSession = NULL; + } + + if ( iRootEntry ) + { + delete iRootEntry; + iRootEntry = NULL; + } + + if ( iMessages ) + { + iMessages->Reset(); + delete iMessages; + iMessages = NULL; + } + + if(iMessageArray) + { + iMessageArray->Reset(); + iMessageArray->Close(); + delete iMessageArray; + iMessageArray = NULL; + } + + PRINT ( _L("End CCsMsgHandler::~CCsMsgHandler") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::ConstructL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +void CCsMsgHandler::ConstructL(MCsMsgObserver *aMsgObserver) + { + PRINT ( _L("Enter CCsMsgHandler::ConstructL") ); + + iMsgObserver = aMsgObserver; + + iSession = CMsvSession::OpenSyncL(*this); + + iMsgPluginUtility = CCsMsgPluginUtility::NewL(); + + iConverstationEntryList = new(ELeave)RPointerArray(); + + iMtmRegistry = CClientMtmRegistry::NewL( *iSession ); + + iSmsMtm = static_cast( iMtmRegistry-> + NewMtmL( KSenduiMtmSmsUid ) ); + + iMmsMtm = static_cast( iMtmRegistry-> + NewMtmL( KSenduiMtmMmsUid ) ); + + iState = EReadInbox; + + iMessageArray = new (ELeave)RArray (KMessageArrayGranularity); + + iMessageCount = 0; + + PRINT ( _L("End CCsMsgHandler::ConstructL") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::CCsMsgHandler +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsMsgHandler::CCsMsgHandler() + { + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::ProcessResultsL() +// ProcessResultsL fetches results for the searchsort query and +// updates the CCsServer with the fetched data +// ----------------------------------------------------------------------------- +// +void CCsMsgHandler::ProcessResultsL(TMsvEntry entry) + { + PRINT ( _L("Enter CCsMsgHandler::ProcessResultsL")); + + // Cleanup the conversationEntry List initially. + // So that the previous entries not cleaned up in + // the event of Leave have been clean up. + iConverstationEntryList->ResetAndDestroy(); + + RPointerArray addressList; + + // Ignore hidden items during upload + if ( entry.Visible() == EFalse ) + { + return; + } + + if ( entry.Parent() == KMsvGlobalInBoxIndexEntryIdValue || + entry.Parent() == KMsvSentEntryIdValue || + entry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) + { + iMsgPluginUtility->CreateContactL(iSession, entry, addressList); + + //process entry + ExtractAddressesL(entry, ERead, addressList); + + addressList.ResetAndDestroy(); + } + + PRINT ( _L("Exit CCsMsgHandler::ProcessResultsL") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::HandleSessionEventL +// Implemented for MMsvSessionObserver +// ---------------------------------------------------------------------------- +// +void CCsMsgHandler::HandleSessionEventL( TMsvSessionEvent aEvent, + TAny* aArg1, + TAny* aArg2, + TAny* /*aArg3*/) + { + PRINT1 ( _L("Enter CCsMsgHandler::HandleSessionEventL aEvent=%d"),aEvent ); + + CMsvEntrySelection* selection=NULL; + TMsvId parent; + + //args + if(aArg1 == NULL || aArg2 == NULL) + { + PRINT ( _L("Enter CCsMsgHandler::HandleSessionEventL arguments invalid")); + return; + } + + //start, processing the event + selection= (CMsvEntrySelection*)aArg1; + parent = *(TMsvId*)aArg2; + + // Cleanup the conversationEntry List initially. + iConverstationEntryList->ResetAndDestroy(); + + switch( aEvent ) + { + case EMsvEntriesChanged: + case EMsvEntriesMoved: + { + HandleEventL(selection,parent); + } + break; + + case EMsvEntriesDeleted: + { + if ( parent == KMsvGlobalInBoxIndexEntryIdValue || + parent == KMsvSentEntryIdValue || + parent == KMsvGlobalOutBoxIndexEntryIdValue) + { + for( TInt i=0 ; i < selection->Count() ; i++ ) + { + TMsvId id = selection->At( i ); + + //use utility to create conversation entry + CCsConversationEntry *conversationEntry = + iMsgPluginUtility->CreateConversationEntryL( + NULL, + id, + 0, + parent, + NULL, + ECsSendStateUnknown, + ECsAttributeNone, + 0); + CleanupStack::PushL(conversationEntry); + iConverstationEntryList->AppendL( conversationEntry ); + CleanupStack::Pop(conversationEntry); + + // call observer interface for each entry + iMsgObserver->HandleDeleteCompleteL(iConverstationEntryList); + + //cleanup before next iteration + iConverstationEntryList->ResetAndDestroy(); + } + } + } + break; + + case EMsvMediaChanged: + iMsgObserver->HandleRefreshCompleteL(); + break; + } + + // Cleanup the conversationEntry List before function exits. + iConverstationEntryList->ResetAndDestroy(); + PRINT ( _L("Exit CCsMsgHandler::HandleSessionEventL") ); + } + +// --------------------------------------------------------------------- +// CCsMsgHandler::HandleEvent +// Handle events +// --------------------------------------------------------------------- +// +void CCsMsgHandler::HandleEventL(CMsvEntrySelection* aSelection, TMsvId aParent) + { + PRINT ( _L("Enter CCsMsgHandler::HandleEvent") ); + TMsvEntry entry; + TMsvId service; + TInt error= KErrNone; + RPointerArray addressList; + + for( TInt i=0 ; i < aSelection->Count() ; i++ ) + { + error = iSession->GetEntry(aSelection->At(i),service,entry); + + if ( entry.Visible() == EFalse ) + { + // Do a delete if entry becomes invisible. + // e.g) My Nokia registration messages. + RPointerArray* hiddenEntries = + new (ELeave) RPointerArray(); + + CCsConversationEntry *conversationEntry = + iMsgPluginUtility->CreateConversationEntryL ( + NULL, + entry.Id(), + 0, + aParent, + NULL, + ECsSendStateUnknown, + ECsAttributeNone, + 0 ); + CleanupStack::PushL(conversationEntry); + hiddenEntries->AppendL( conversationEntry ); + CleanupStack::Pop(conversationEntry); + + // Delete at server + iMsgObserver->HandleDeleteCompleteL(hiddenEntries); + hiddenEntries->ResetAndDestroy(); + hiddenEntries->Close(); + delete hiddenEntries; + + break; + } + + if ( (KErrNone == error) && (IsMtmSupported(entry.iMtm.iUid) ) ) + { + // sent/inbox/Outbox entry + if ( aParent == KMsvSentEntryIdValue || + aParent == KMsvGlobalInBoxIndexEntryIdValue ) + { + // currently server needs number, so getting it from header + iMsgPluginUtility->CreateContactL(iSession, entry, + addressList); + + //process entry + // entry created in sent already exists, hence an update + ExtractAddressesL(entry, EUpdate, addressList); + + addressList.ResetAndDestroy(); + } + + //for drafts and outbox, the entry changes multiple times, + // so making a check if entry has changed + else if(aParent == KMsvGlobalOutBoxIndexEntryIdValue) + { + //outbox + if(!(iMsgPluginUtility->CompareEntry(iPrevEntry,entry,aParent))) + { + TUint sendState = entry.SendingState(); + + // if the entry state is sent, we dont need to process it + // as it is going to appear in sent items + if( ECsSendStateSent != iMsgPluginUtility->GetSendState(entry) ) + { + // currently server needs number, so getting it from header + iMsgPluginUtility->CreateContactL(iSession, entry, + addressList); + + //process entry + // entry created in sent already exists, hence an update + ExtractAddressesL(entry, EUpdate, addressList); + + iPrevEntry = entry; + + addressList.ResetAndDestroy(); + } + }//end check changed entry + } + } + }//end for loop + + PRINT ( _L("Exit CCsMsgHandler::HandleEvent") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::CreateAndAddEntryL +// Creates CCsConversationEntry and adds to the list +// ---------------------------------------------------------------------------- +// +void CCsMsgHandler::CreateAndAddEntryL(const TDesC& aContact, + const TDesC& aDescription, + const TMsvEntry& aEntry) + { + PRINT ( _L("Enter CCsMsgHandler::CreateAndAddEntryL") ); + + HBufC* contact = NULL; + HBufC* sDescription = NULL; + + if (aContact.Length()>0) + { + contact = aContact.AllocL(); + CleanupStack::PushL(contact); + } + if (aDescription.Length()>0) + { + sDescription = aDescription.AllocL(); + CleanupStack::PushL(sDescription); + } + + //use utility to create conversation entry + CCsConversationEntry *conversationEntry = iMsgPluginUtility->CreateConversationEntryL( + contact, + aEntry.Id(), + aEntry.iDate.Int64(), + aEntry.Parent(), + sDescription, + iMsgPluginUtility->GetSendState(aEntry), + iMsgPluginUtility->GetMsgAttributes(aEntry), + ExtractCsType(aEntry)); + CleanupStack::PushL(conversationEntry); + + //add to the list + iConverstationEntryList->AppendL( conversationEntry ); + CleanupStack::Pop(conversationEntry); + + // cleanup + if (sDescription) + { + CleanupStack::PopAndDestroy(sDescription); + } + if (contact) + { + CleanupStack::PopAndDestroy(contact); + } + + PRINT ( _L("Exit CCsMsgHandler::CreateAndAddEntryL") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::ProcessEntryL +// Creates CCsConversationEntry and adds to the list +// ---------------------------------------------------------------------------- +// +void CCsMsgHandler::ProcessEntryL( TEventType aEvent, const TDesC& aContact, + const TDesC& aDescription, const TMsvEntry& aEntry) + { + PRINT ( _L("Enter CCsMsgHandler::ProcessEntryL") ); + + // create and add entry to the list + CreateAndAddEntryL(aContact,aDescription,aEntry); + + // call cs observer interface for each entry + switch(aEvent) + { + case ERead: + { + iMsgObserver->HandleReadCompleteL(iConverstationEntryList); + } + break; + case EUpdate: + { + iMsgObserver->HandleUpdateCompleteL(iConverstationEntryList); + } + break; + } + + // Cleanup the conversationEntry List, as we are just sending one entry at a time + iConverstationEntryList->ResetAndDestroy(); + + PRINT ( _L("Exit CCsMsgHandler::ProcessEntryL") ); + } + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::ExtractAddressL +// Extracts the addresses in the to field and updates them to server +// ---------------------------------------------------------------------------- +// +void CCsMsgHandler::ExtractAddressesL( + TMsvEntry aEntry, + TEventType aEvent, + RPointerArray& addressList ) + { + PRINT ( _L("Enter CCsMsgHandler::ExtractAddressesL") ); + + // For SMS read the whole body. + // For bio type SMS read the iDescription + // For other message types read the iDescription + // Note: After the LoadMessageL() the iDescription is getting + // deleted so need to make a copy before that. + TPtrC description; + HBufC* tmpBuffer = NULL; + + if ( (aEntry.iBioType && + aEntry.iBioType != KUidMsgSubTypeMmsAudioMsg.iUid ) || + aEntry.iMtm == KSenduiMtmBtUid ) + { + tmpBuffer = aEntry.iDescription.AllocL(); + description.Set( tmpBuffer->Des() ); + } + else if ( aEntry.iMtm == KSenduiMtmSmsUid ) + { + iSmsMtm->SwitchCurrentEntryL( aEntry.Id() ); + iSmsMtm->LoadMessageL(); + + CRichText& body = iSmsMtm->Body(); + TInt smsLength = body.DocumentLength(); + tmpBuffer = HBufC::NewL(smsLength); + TPtr ptr(tmpBuffer->Des()); + body.Extract(ptr, 0); + description.Set( tmpBuffer->Des() ); + } + else if ( aEntry.iMtm == KSenduiMtmMmsUid || + aEntry.iMtm == KSenduiMMSNotificationUid) + { + tmpBuffer = aEntry.iDescription.AllocL(); + description.Set( tmpBuffer->Des() ); + + iMmsMtm->SwitchCurrentEntryL( aEntry.Id() ); + iMmsMtm->LoadMessageL(); + + // Handle addresses + if ( aEntry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) + { + HBufC* address = iMmsMtm->Sender().AllocL(); + addressList.Append(address); + } + else if ( aEntry.Parent() == KMsvSentEntryIdValue || + aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) + { + const CMsvRecipientList& addresses = iMmsMtm->AddresseeList(); + TInt count = addresses.Count(); + + for( TInt i = 0; i < count; i++) + { + HBufC* address = addresses[i].AllocL(); + TPtrC pureAddress = iMsgPluginUtility->PureAddress(*address); + HBufC* address1 = pureAddress.AllocL(); + addressList.Append(address1); + delete address; + } + } + } + else + { + return; + } + + if ( addressList.Count() > 0 ) + { + for ( int i = 0; i < addressList.Count(); i++ ) + { + HBufC* address = addressList[i]; + ProcessEntryL(aEvent, *address, description, aEntry); + } + } + else + { + // Unknown + ProcessEntryL(aEvent, KNullDesC, description, aEntry); + } + + delete tmpBuffer; + + PRINT ( _L("Exit CCsMsgHandler::ExtractAddressesL") ); + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::CompareOrder() +// Method for determining the sorting behaviour of RArray of TMsvId's +// ----------------------------------------------------------------------------- +// +static TInt CompareOrder(const TMsvId& aFirst, const TMsvId& aSecond) + { + return aSecond - aFirst; + } +// ----------------------------------------------------------------------------- +// CCsMsgHandler::UploadMsgL() +// State machine to upload all messages +// ----------------------------------------------------------------------------- +// +TInt CCsMsgHandler::UploadMsgL() +{ + switch ( iState ) + { + case EReadInbox: + { + iRootEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId); + + // Set sort order + TMsvSelectionOrdering order; + order.SetSorting(EMsvSortById); + iRootEntry->SetSortTypeL(order); + + iMessages = iRootEntry->ChildrenL(); + iMessageCount = iRootEntry->Count(); + if(iMessageCount) + { + for(int i = 0; i < iMessageCount; i ++) + { + iMessageArray->Append(iMessages->At(i)); + } + } + + iState = EReadSent; + CleanupL(); + + return 1; + } + + case EReadSent: + { + iRootEntry = iSession->GetEntryL(KMsvSentEntryId); + + // Set sort order + TMsvSelectionOrdering order; + order.SetSorting(EMsvSortById); + iRootEntry->SetSortTypeL(order); + + iMessages = iRootEntry->ChildrenL(); + iMessageCount = iRootEntry->Count(); + if(iMessageCount) + { + for(int i = 0; i < iMessageCount; i++ ) + { + iMessageArray->Append(iMessages->At(i)); + } + } + + iState = EReadOutbox; + CleanupL(); + + return 1; + } + + case EReadOutbox: + { + iRootEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId); + + // Set sort order + TMsvSelectionOrdering order; + order.SetSorting(EMsvSortById); + iRootEntry->SetSortTypeL(order); + + iMessages = iRootEntry->ChildrenL(); + iMessageCount = iRootEntry->Count(); + + if(iMessageCount) + { + for(int i = 0; i < iMessageCount; i ++) + { + iMessageArray->Append(iMessages->At(i)); + } + iMessageCount=0; + } + iState = ESortEntries; + CleanupL(); + + return 1; + } + case ESortEntries: + { + //Sort the elements in the array by descending order of TMsvId's + TLinearOrder order(CompareOrder); + iMessageArray->Sort(order); + iState = EProcessEntries; + return 1; + } + + case EProcessEntries: + { + //Process one entry at a time in sequence + //Process the first element in the array on each call, till the end + if(iMessageArray->Count()) + { + ProcessResultsL(iSession->GetEntryL(iMessageArray->operator[](0))->Entry()); + iMessageArray->Remove(0); + } + else + { + iMsgObserver->HandleCachingCompleted(); + return 0; //DONE + } + + iState = EProcessEntries; + return 1; + } + } + return 0; +} + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::UploadMsg() +// CIdle callback +// ----------------------------------------------------------------------------- +// +TInt CCsMsgHandler::UploadMsg(TAny* aArg) + { + CCsMsgHandler* handler = (CCsMsgHandler*) aArg; + TInt ok = 0; + TRAPD(err, ok = handler->UploadMsgL()); + return ((err == KErrNone) && ok); + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::StartL() +// This function starts the state machine to fetch sms data from msvserver +// ----------------------------------------------------------------------------- +// +void CCsMsgHandler::StartL() + { + PRINT ( _L("Enter CCsMsgHandler::Start") ); + + iState = EReadInbox; + TCallBack callback = TCallBack(UploadMsg, (TAny*) this); + iIdle = CIdle::NewL(CActive::EPriorityLow); + iIdle->Start(callback); + + PRINT ( _L("End CCsMsgHandler::Start") ); + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::CleanupL() +// Helper function for state machine cleanup +// ----------------------------------------------------------------------------- +// +void CCsMsgHandler::CleanupL() + { + if ( iRootEntry ) + { + delete iRootEntry; + iRootEntry = NULL; + } + + if ( iMessages ) + { + iMessages->Reset(); + delete iMessages; + iMessages = NULL; + } + + iMessageCount = 0; + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::IsMtmSupported() +// +// ----------------------------------------------------------------------------- +// +TBool CCsMsgHandler::IsMtmSupported(long uid) + { + if ( KSenduiMtmSmsUidValue == uid || \ + KSenduiMtmBtUidValue == uid || \ + KSenduiMtmMmsUidValue == uid || \ + KSenduiMtmBioUidValue == uid || \ + KSenduiMMSNotificationUidValue == uid || \ + KUidMtmWapPush == TUid::Uid(uid) ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CCsMsgHandler::ExtractCsType() +// Extracts the Message type based on the MTM Uid +// ----------------------------------------------------------------------------- +// +TCsType CCsMsgHandler::ExtractCsType( const TMsvEntry& aEntry) + { + TCsType type = ECsUnknown; + switch(aEntry.iMtm.iUid) + { + case KSenduiMtmSmsUidValue: + type = ECsSMS; + if (aEntry.iBioType == KMsgBioUidVCard.iUid) + { + type = ECsBioMsg_VCard; + } + break; + case KSenduiMtmBtUidValue: + type = ECsBlueTooth; + break; + case KSenduiMtmMmsUidValue: + if(aEntry.iBioType == KUidMsgSubTypeMmsAudioMsg.iUid) + { + type = ECsAudio; + } + else + { + type = ECsMMS; + } + break; + case KSenduiMMSNotificationUidValue: + type = ECsMmsNotification; + break; + case KSenduiMtmBioUidValue: + { + type = ECsBioMsg; + + // based on the biotype uid set message type + if(aEntry.iBioType == KMsgBioUidRingingTone.iUid) + { + type = ECsRingingTone; + } + else if(aEntry.iBioType == KMsgBioProvisioningMessage.iUid) + { + type = ECsProvisioning; + } + else if (aEntry.iBioType == KMsgBioUidVCard.iUid) + { + type = ECsBioMsg_VCard; + } + else if (aEntry.iBioType == KMsgBioUidVCalendar.iUid) + { + type = ECsBioMsg_VCal; + } + } + break; + default: + type = ECsUnknown; + break; + } + return (type); + } +// End of file + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/src/ccsmsgpluginutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsgpluginutility.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,462 @@ +/* +* Copyright (c) 2007 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: CS Msg Plugin Utility class + * +*/ + + +// USER INCLUDES +#include "ccsmsgpluginutility.h" +#include "ccsdebug.h" + +//SYSTEM INCLUDES +#include +#include +#include +#include +#include + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +CCsMsgPluginUtility* CCsMsgPluginUtility::NewL( ) + { + CCsMsgPluginUtility* self = new ( ELeave ) CCsMsgPluginUtility(); + return self; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::~CCsMsgPluginUtility +// Destructor +// ---------------------------------------------------------------------------- +CCsMsgPluginUtility::~CCsMsgPluginUtility() + { + } + +// ---------------------------------------------------------------------------- +// Constructor +// ---------------------------------------------------------------------------- +CCsMsgPluginUtility::CCsMsgPluginUtility() + { + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::CreateConversationEntryL +// Creates CCsConversationEntry +// ---------------------------------------------------------------------------- +// +CCsConversationEntry* CCsMsgPluginUtility::CreateConversationEntryL( + const HBufC* aContact, + TMsvId aEnryId, + TInt64 aTimeStamp, + TMsvId aDir, + const HBufC* aDescription, + TCsSendState aSendState, + TCsAttribute aMsgAttribs, + TCsType aCsType) const + { + // create CCsConversationEntry + CCsConversationEntry *conversationEntry = CCsConversationEntry::NewL(); + CleanupStack::PushL(conversationEntry); + + //set the values + conversationEntry->SetContactL( *aContact ); + conversationEntry->SetEntryId( aEnryId ); + conversationEntry->SetTimeStampL( aTimeStamp ); + conversationEntry->SetDescriptionL( *aDescription ); + conversationEntry->SetConversationDir( MapDirection( aDir ) ); + conversationEntry->SetSendState( aSendState ); + conversationEntry->ChangeAttributes( aMsgAttribs, ECsAttributeNone ); + conversationEntry->SetType(aCsType); + + //pop and return + CleanupStack::Pop(conversationEntry); + return conversationEntry; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::MapDirection +// Map the msg direction to TCsDirection +// ---------------------------------------------------------------------------- +// +TCsDirection CCsMsgPluginUtility::MapDirection( TMsvId aDir ) const + { + TCsDirection direction = ECsDirectionUnknown; + switch(aDir) + { + case KMsvSentEntryIdValue: + case KMsvGlobalOutBoxIndexEntryIdValue: // Fall-through + case KMsvDraftEntryIdValue: + { + direction = ECsDirectionOutgoing; + break; + } + case KMsvGlobalInBoxIndexEntryIdValue: + { + direction = ECsDirectionIncoming; + break; + } + } + return direction; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::GetMsgAttributes +// Returns the message attributes as a bitmask of TCsAttribute values. +// ---------------------------------------------------------------------------- +// +TUint16 CCsMsgPluginUtility::GetMsgAttributes( const TMsvEntry& aEntry ) + { + TUint16 msgAttributes = ECsAttributeNone; + TMsvId parent = aEntry.Parent(); + + // New + if( aEntry.New() ) + { + msgAttributes |= ECsAttributeNew; + } + + // Drafts + if( KMsvDraftEntryIdValue == parent ) + { + msgAttributes |= ECsAttributeDraft; + } + + // Attachments + if( aEntry.Attachment() ) + { + msgAttributes |= ECsAttributeAttachment; + } + + // Priority + TMsvPriority priority = aEntry.Priority(); + if( EMsvHighPriority == priority ) + { + msgAttributes |= ECsAttributeHighPriority; + } + else if( EMsvLowPriority == priority ) + { + msgAttributes |= ECsAttributeLowPriority; + } + + // Read/Unread + if( KMsvGlobalInBoxIndexEntryIdValue == parent ) + { + if( EFalse == aEntry.Unread() ) + { + // Read + msgAttributes &= ~ECsAttributeUnread; + } + else + { + // Unread + msgAttributes |= ECsAttributeUnread; + } + } + + // Sent + if( KMsvSentEntryIdValue == parent ) + { + msgAttributes |= ECsAttributeSent; + } + + return msgAttributes; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::GetSendState +// Returns the send status. +// ---------------------------------------------------------------------------- +// +TCsSendState CCsMsgPluginUtility::GetSendState( const TMsvEntry& aContext ) + { + TUint sendingState = aContext.SendingState(); + TCsSendState convSendState = ECsSendStateUnknown; + + switch( sendingState ) + { + case KMsvSendStateUponRequest: + { + convSendState = ECsSendStateUponRequest; + break; + } + case KMsvSendStateWaiting: + { + convSendState = ECsSendStateWaiting; + break; + } + case KMsvSendStateSending: + { + convSendState = ECsSendStateSending; + break; + } + case KMsvSendStateScheduled: + { + convSendState = ECsSendStateScheduled; + break; + } + case KMsvSendStateResend: + { + convSendState = ECsSendStateResend; + break; + } + case KMsvSendStateSuspended: + { + convSendState = ECsSendStateSuspended; + break; + } + case KMsvSendStateFailed: + { + convSendState = ECsSendStateFailed; + break; + } + case KMsvSendStateSent: + { + convSendState = ECsSendStateSent; + break; + } + case KMsvSendStateNotApplicable: + { + convSendState = ECsSendStateNotApplicable; + break; + } + } + return convSendState; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::GetContact +// Get the Contact (From/To) of the message +// ---------------------------------------------------------------------------- +// +void CCsMsgPluginUtility::CreateContactL(CMsvSession* aSession, + const TMsvEntry& aEntry, + RPointerArray& addressList) + { + if ( aEntry.iMtm.iUid == KSenduiMtmSmsUidValue ) + { + CPlainText* nullString = CPlainText::NewL(); + CleanupStack::PushL( nullString ); + + CSmsHeader* smsHeader = NULL; + if ( aEntry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) + { + smsHeader = CSmsHeader::NewL( CSmsPDU::ESmsDeliver, *nullString ); + } + else if ( aEntry.Parent() == KMsvSentEntryIdValue || + aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue ) + { + smsHeader = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *nullString ); + } + else + { + CleanupStack::PopAndDestroy(nullString); + return; + } + CleanupStack::PushL( smsHeader ); + + CMsvEntry *cEntry = CMsvEntry::NewL(*aSession,aEntry.Id(), + TMsvSelectionOrdering() ); + CleanupStack::PushL( cEntry ); + + CMsvStore* store = cEntry->ReadStoreL(); + CleanupStack::PushL(store); + + TRAPD(err, smsHeader->RestoreL( *store )); + if ( err == KErrNone ) + { + if ( aEntry.Parent() == KMsvGlobalOutBoxIndexEntryIdValue || + aEntry.Parent() == KMsvSentEntryIdValue ) + { + const CArrayPtrFlat& rcpts = smsHeader->Recipients(); + const CSmsNumber& rcpt = *rcpts.At(0); + + HBufC* fromAddress = (rcpt.Address()).AllocL(); + addressList.Append(fromAddress); + } + else + { + // Check and add if any email addresses + const CSmsEmailFields& emailFields = smsHeader->EmailFields(); + if( emailFields.HasAddress() ) + { + TPtrC name; + TPtrC address; + + const MDesCArray& emailRecipients = emailFields.Addresses(); + for( TInt id = 0; id < emailRecipients.MdcaCount(); id++ ) + { + NameAndAddress( emailRecipients.MdcaPoint( id ), name, address); + + // Add address to list + HBufC* addressBuf = HBufC::NewL( address.Length() ); + TPtr addressPtr( 0, 0 ); + addressPtr.Set( addressBuf->Des() ); + addressPtr.Copy( address ); + addressList.Append(addressBuf); + } + } + else + { + HBufC* fromAddress = (smsHeader->FromAddress()).AllocL(); + + // Try iDetails if empty + if ( fromAddress->Length() == 0 ) + fromAddress = aEntry.iDetails.AllocL(); + + addressList.Append(fromAddress); + } + } + } + + // Cleanup + CleanupStack::PopAndDestroy(store); + CleanupStack::PopAndDestroy(cEntry); + CleanupStack::PopAndDestroy(smsHeader); + CleanupStack::PopAndDestroy(nullString); + } + else if ( aEntry.iMtm.iUid == KSenduiMtmBtUidValue || + aEntry.iMtm.iUid == KSenduiMtmBioUidValue || + aEntry.iMtm == KUidMtmWapPush ) + { + HBufC* fromAddress = aEntry.iDetails.AllocL(); + addressList.Append(fromAddress); + } + } + +// --------------------------------------------------------- +// CCsMsgPluginUtility::CompareEntry +// +// --------------------------------------------------------- +TBool CCsMsgPluginUtility::CompareEntry( const TMsvEntry& aOldContext, + const TMsvEntry& aNewContext, TMsvId aDir ) const + { + if( (aOldContext.Id() == aNewContext.Id()) + && (aOldContext.Parent() == aNewContext.Parent()) + && (0 == aOldContext.iDescription.Compare(aNewContext.iDescription)) ) + { + // incase of outbox, check sending state also + if(aDir == KMsvGlobalOutBoxIndexEntryIdValue) + { + if(aOldContext.SendingState() == aNewContext.SendingState()) + return ETrue; + else + return EFalse; + } + return ETrue; + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CCsMsgPluginUtility::NameAndAddress +// Extracts name and address from the aMsvAddress +// which is of the form name
+// ---------------------------------------------------------------------------- +void CCsMsgPluginUtility::NameAndAddress( const TPtrC& aMsvAddress, + TPtrC& aName, + TPtrC& aAddress ) + { + // For address information separation (start) + const TUint KMsgSmsAddressStartChar ('<'); + + // For address information separation (end) + const TUint KMsgSmsAddressEndChar ('>'); + + TInt addressStart = aMsvAddress.LocateReverse( KMsgSmsAddressStartChar ); + TInt addressEnd = aMsvAddress.LocateReverse( KMsgSmsAddressEndChar ); + + if ( addressStart != KErrNotFound && addressEnd != KErrNotFound + && addressEnd > addressStart ) + { + // verified address, will be used as selected from contacts manager + aName.Set( aMsvAddress.Ptr(), addressStart ); + aAddress.Set( + aMsvAddress.Mid( addressStart + 1 ).Ptr(), + ( addressEnd - addressStart ) -1 ); + if ( !aAddress.Length()) + { + aAddress.Set( aName ); + aName.Set( KNullDesC ); // empty string + } + } + else + { + // unverified string, will be used as entered in the header field + aName.Set( KNullDesC ); // empty string + aAddress.Set( aMsvAddress.Ptr(), aMsvAddress.Length() ); // a whole string to address + } + + if ( aName.CompareF( aAddress ) == 0 ) + { + aName.Set( KNullDesC ); // empty string + } + } + +// --------------------------------------------------------- +// CCsMsgPluginUtility::PureAddress +// Extract the phone number for MMS +// --------------------------------------------------------- +// +TPtrC CCsMsgPluginUtility::PureAddress( const TDesC& aAddress ) + { + _LIT( KOpen, "<" ); + _LIT( KClose, ">" ); + + // syntax is : + // | + // + TInt firstPos = 0; + TInt lastPos = 0; + TInt length = aAddress.Length(); + TInt sepaLen1 = KOpen().Length(); + TInt sepaLen2 = KClose().Length(); + TInt firstSeparatorPosition = 0; + + while( firstSeparatorPosition >= 0 ) + { + firstSeparatorPosition = aAddress.Mid( firstPos ).Find( KOpen ); + if ( firstSeparatorPosition >= 0 ) + { + firstPos += firstSeparatorPosition + sepaLen1; + } + } + if ( firstPos <= 0 ) + { + // No alias + return aAddress; + } + + // Check if the second separator ends the address + TPtrC last = aAddress.Right( sepaLen2 ); + lastPos = length - sepaLen2; + + if ( !last.Compare( KClose ) ) + { + // Alias part found + if ( lastPos > firstPos ) + { + return aAddress.Mid( firstPos, lastPos - firstPos ); + } + } + // No alias defined - return the original string as pure address + // If syntax is weird, namely + // alias <> + // with nothing between the separators, we return the original string as is + return aAddress; + } + +//End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/msgplugin/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/proxy.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 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: ECOM Plugin proxy details + * +*/ + + +// INCLUDES +#include +#include +#include "ccsmsg.h" + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(0x2002A5B7, CCsMsg::NewL ) +}; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/plugins.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/plugins.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +# Platforms +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +# Build.inf rules + +SUBDIRS += msgplugin previewplugin diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2006-2007 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: CS Preview Plugin +* +*/ +#include +#include + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT +TARGET cspreviewplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20026F49 + +VERSION 1.0 + +PAGED + +// RESOURCE +START RESOURCE ../rss/cspreviewplugin.rss +TARGET cspreviewplugin.rsc +END + +SOURCEPATH ../src + +SOURCE proxy.cpp +SOURCE ccspreviewplugin.cpp +SOURCE ccspreviewpluginhandler.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../server/inc +USERINCLUDE ../../../utils/inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../msgutils/unidatautils/unidatamodel/inc +APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY eCom.lib +LIBRARY csutils.lib +LIBRARY efsrv.lib + +DEBUGLIBRARY flogger.lib + +// Msg Server +LIBRARY Smcm.lib +LIBRARY gsmu.lib +LIBRARY etext.lib +LIBRARY msgs.lib +LIBRARY sqldb.lib +LIBRARY thumbnailmanager.lib +LIBRARY fbscli.lib +LIBRARY estor.lib +LIBRARY unidatamodel.lib +LIBRARY charconv.lib \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewplugin.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2007 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: Preview Plugin main class + * +*/ + + +#ifndef _C_CS_PREVIEW_PLUGIN_H_ +#define _C_CS_PREVIEW_PLUGIN_H_ + +// INCLUDE FILES + +// SYSTEM INCLUDES + +// USER INCLUDES +#include "ccsplugin.h" +#include "ccsdebug.h" +#include "ccsdefs.h" + +// FORWARD DECLARATION +class MCsPluginEventObserver; +class CCsConversationEntry; +class CCsPreviewPluginHandler; + +/** + * Preview plugin class + * + */ +class CCsPreviewPlugin : public CCsPlugin + { +public: + + /** + * Two phase construction + */ + static CCsPreviewPlugin* NewL( MCsPluginEventObserver* aMCsPluginEventObserver); + + /** + * Destructor + */ + virtual ~CCsPreviewPlugin(); + + +public: // From base class CCsPlugin + /** + * GetConversationsL + * This function starts the state machine to fetch msg data from msvserver + */ + void GetConversationsL(); + +public: + + /** + * HandleCachingCompleted + * Sends the cache completed status to server + */ + void HandleCachingCompleted(); + + /** + * HandleCachingError + * Sends the error occured during the caching to server + */ + void HandleCachingError(const TInt aError); + +private: + + /** + * Constructor + */ + CCsPreviewPlugin(MCsPluginEventObserver* aObserver); + + /** + * 2nd phase construtor + */ + void ConstructL(); + +private: //Data + + /** + * MMS Preview Handler + * Own + */ + CCsPreviewPluginHandler* iPreviewPluginHandler; + + /** + * iPluginEventObserver + * Plugin event observer + * Not Own. + */ + MCsPluginEventObserver* iPluginEventObserver; + }; + +#endif // _C_CS_PREVIEW_PLUGIN_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewpluginhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewpluginhandler.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2007 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: Message Preview Handler + * + */ + +#ifndef _C_CS_PREVIEW_PLUGIN_HANDLER_H_ +#define _C_CS_PREVIEW_PLUGIN_HANDLER_H_ + +//SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include + +//USER INCLUDES +#include "ccspreviewplugin.h" +#include "UniDataModel.h" + +// FORWARD DECLARATION +class CCsPlugin; +class CMsvSession; +class MCsPluginEventObserver; +class MMsvSessionObserver; +class CCsConversationEntry; +class CCsPreviewPlugin; +class CClientMtmRegistry; +class CMmsClientMtm; + +/* + * Thumbnail Request Data + */ +struct ThumbnailRequestData + { + /* + * Request Id + */ + TThumbnailRequestId iRequestId; + + /* + * Message Id + */ + TMsvId iMsgId; + }; + +/** + * This class interacts with MsvServer to fetch message data + */ +class CCsPreviewPluginHandler : public CBase, + public MMsvSessionObserver, + public MUniDataModelObserver, + public MThumbnailManagerObserver + { + +public: + + /** + * Two phase construction + */ + static CCsPreviewPluginHandler* NewL(CCsPreviewPlugin *aMsgObserver); + + /** + * Destructor + */ + virtual ~CCsPreviewPluginHandler(); + +public: + //MMsvSessionObserver + /** + * Handles the MsvServer updates. Implemented for MMsvSessionObserver + */ + void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, + TAny* aArg2, TAny* aArg3); + +public: + //MUniDataModelObserver + /** + */ + void RestoreReady(TInt aParseResult, TInt aError); + +public: + // Callbacks from MThumbnailManagerObserver for getting thumbnails + void ThumbnailPreviewReady(MThumbnailData& aThumbnail, + TThumbnailRequestId aId); + + void ThumbnailReady(TInt aError, MThumbnailData& aThumbnail, + TThumbnailRequestId aId); + +public: + + /* + * Compare by request Id. + */ + static TBool CompareByRequestId(const ThumbnailRequestData& aFirst, + const ThumbnailRequestData& aSecond); + +private: + + /** + * Constructor + */ + CCsPreviewPluginHandler(); + + /** + * 2nd phase construtor + */ + void ConstructL(CCsPreviewPlugin *aMsgPlugin); + + /** + * Process each entry + *@param aSelection, CMsvEntrySelections + */ + void HandleEventL(CMsvEntrySelection* aSelection); + + /** + * Bind bodytext to sql statement. + *@param sqlStmt, RSqlStatement + *@param attachmentId, TMsvAttachmentId + */ + void BindBodyText(RSqlStatement& sqlStmt, TMsvAttachmentId attachmentId); + + /** + * Get Thumbnail data from attachment + *@param attachmentId, TMsvAttachmentId + *@param mimeType, + *@param msgId, message id + */ + void GetThumbNailL(TMsvAttachmentId attachmentId, TDesC8& mimeType, + TMsvId msgId); + + /* + * Process Thumbnail data + * @param aThumbnail MThumbnailData + * @param aId TThumbnailRequestId + */ + void HandleThumbnailReadyL(MThumbnailData& aThumbnail, + TThumbnailRequestId aId); + +private: + //Data + + /** + * MsvServer session object + * Own + */ + CMsvSession* iSession; + + /** + * iMsgObserver + * The Observer interface + * Not Own. + */ + CCsPreviewPlugin *iMsgObserver; + + /** + * Mtm registry object + * Own + */ + CClientMtmRegistry* iMtmRegistry; + + /** + * Mms client mtm object + * Own. + */ + CMmsClientMtm* iMmsMtm; + + /* + * File session + */ + RFs ifsSession; + + /* + * Thumbnail request array. + * Own + */ + RArray iThumbnailRequestArray; + + /* + * Thumbnail manager. + * Own + */ + CThumbnailManager* iThumbnailManager; + + /* + * Sqlite DB Handle + */ + RSqlDatabase iSqlDb; + }; + +#endif // _C_CS_PREVIEW_PLUGIN_HANDLER_H_ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/previewplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/previewplugin.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +# Platforms +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +# Build.inf rules + +symbian { + BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "./rom/cspreviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cspreviewplugin.iby)" +} + +symbian { +BLD_INF_RULES.prj_mmpfiles = "./group/cspreviewplugin.mmp" +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/rom/cspreviewplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/rom/cspreviewplugin.iby Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CS_PREVIEW_PLUGIN_IBY__ +#define __CS_PREVIEW_PLUGIN_IBY__ + +ECOM_PLUGIN(cspreviewplugin.dll, cspreviewplugin.rsc) + +// csmsg plugin resource +data=DATAZ_\RESOURCE_FILES_DIR\plugins\cspreviewplugin.rsc RESOURCE_FILES_DIR\plugins\cspreviewplugin.rsc + + +#endif // __CS_PREVIEW_PLUGIN_IBY__ + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/rss/cspreviewplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/rss/cspreviewplugin.rss Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2007 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 + +RESOURCE REGISTRY_INFO theInfo +{ + // UID for the DLL + dll_uid = 0x20026F49; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + + // UID of interface that is implemented + interface_uid = 0x2002A545; + + implementations = + { + + // Info for all implementations + IMPLEMENTATION_INFO + { + implementation_uid = 0x20024329; + version_no = 1; + display_name = "Preview Plugin"; + default_data = "CS Plugin"; + opaque_data = ""; + } + + }; + } + }; +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewplugin.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 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: Message Preview Plugin main class + * +*/ + + +// SYSTEM INCLUDES +#include + +// USER INCLUDES +#include "ccspreviewplugin.h" +#include "ccspreviewpluginhandler.h" + +// ============================== MEMBER FUNCTIONS ============================ +// ---------------------------------------------------------------------------- +// CCsPreviewPlugin::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsPreviewPlugin* CCsPreviewPlugin::NewL(MCsPluginEventObserver* aObserver) + { + PRINT ( _L("Enter CCsPreviewPlugin::NewL") ); + + CCsPreviewPlugin* self = new ( ELeave ) CCsPreviewPlugin(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + PRINT ( _L("End CCsPreviewPlugin::NewL") ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CCsPreviewPlugin::CCsPreviewPlugin +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsPreviewPlugin::CCsPreviewPlugin(MCsPluginEventObserver* aObserver):iPluginEventObserver (aObserver) + { + } + +// ---------------------------------------------------------------------------- +// CCsPreviewPlugin::ConstructL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +void CCsPreviewPlugin::ConstructL() + { + PRINT ( _L("Enter CCsPreviewPlugin::ConstructL") ); + iPreviewPluginHandler=CCsPreviewPluginHandler::NewL(this); + PRINT ( _L("Exit CCsPreviewPlugin::ConstructL") ); + } +// ---------------------------------------------------------------------------- +// CCsPreviewPlugin::~CCsPreviewPlugin +// Destructor +// ---------------------------------------------------------------------------- +// +CCsPreviewPlugin::~CCsPreviewPlugin() + { + PRINT ( _L("Enter CCsPreviewPlugin::~CCsPreviewPlugin") ); + + if(iPreviewPluginHandler) + delete iPreviewPluginHandler; + iPreviewPluginHandler = NULL; + + PRINT ( _L("End CCsPreviewPlugin::~CCsPreviewPlugin") ); + } + + +// ----------------------------------------------------------------------------- +// CCsPreviewPlugin::HandleCachingCompleted +// Sends the cache completed status to server +// ----------------------------------------------------------------------------- +// +void CCsPreviewPlugin::HandleCachingCompleted() + { + iPluginEventObserver->CachingCompleted(); + } + +// ----------------------------------------------------------------------------- +// CCsPreviewPlugin::HandleCachingError +// Sends the error occured during the caching to server +// ----------------------------------------------------------------------------- +// +void CCsPreviewPlugin::HandleCachingError(const TInt aError) + { + iPluginEventObserver->CachingError(aError); + } + +// ----------------------------------------------------------------------------- +// CCsPreviewPlugin::GetConversationsL() +// This function starts the state machine to fetch msg data from msvserver +// ----------------------------------------------------------------------------- +// +void CCsPreviewPlugin::GetConversationsL() + { + PRINT ( _L("Enter CCsPreviewPlugin::GetConversationsL") ); + //THE initial caching is yet to be handled + HandleCachingCompleted(); + } + + +// End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2007 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: CS Preview Plugin Handler, This class creates and updates sqlite based db + * with the message-preview data. + * + */ +// USER INCLUDES +#include "ccspreviewpluginhandler.h" +#include "UniObject.h" +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +//CONSTANTS +//DB-file +_LIT(KDbFileName, "c:[2002A542]conversations.db"); +//Encoding +_LIT(KEncodingStmnt,"PRAGMA encoding=\"UTF-8\""); +//Size +_LIT(KCacheSizeStmnt,"PRAGMA default_cache_size = 1024"); +// Create table query statement +_LIT(KSqlCreateStmt, "CREATE TABLE IF NOT EXISTS conversation_messages ( message_id INTEGER PRIMARY KEY, msg_parsed INTEGER DEFAULT 0, subject TEXT(100), body_text TEXT(160), preview_path TEXT, msg_property INTEGER, preview_icon BLOB DEFAULT NULL ) " ); +//Insert without bitmap query +_LIT(KSqlInsertStmt, "INSERT OR REPLACE INTO conversation_messages (message_id, msg_parsed, subject, body_text, preview_path, msg_property ) VALUES( :message_id, :msg_parsed, :subject, :body_text, :preview_path, :msg_property )"); +//update with bitmap query +_LIT(KSqlUpdateBitmapStmt, "UPDATE conversation_messages SET preview_icon=:preview_icon WHERE message_id=:message_id " ); +// query to see if msg_parsed is set +_LIT(KSelectMsgParsedStmt, " SELECT message_id, msg_parsed FROM conversation_messages WHERE message_id=:message_id "); +// Remove record from conversation_messages table. +_LIT(KRemoveMsgStmnt,"DELETE FROM conversation_messages WHERE message_id=:message_id"); + +// NOTE:- DRAFTS ENTRIES ARE NOT HANDLED IN THE PLUGIN + +// ============================== MEMBER FUNCTIONS ============================ +// ---------------------------------------------------------------------------- +// CCsPreviewPluginHandler::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsPreviewPluginHandler* CCsPreviewPluginHandler::NewL( + CCsPreviewPlugin *aMsgObserver) +{ + PRINT ( _L("Enter CCsMsgHandler::NewL") ); + + CCsPreviewPluginHandler* self = new (ELeave) CCsPreviewPluginHandler(); + CleanupStack::PushL(self); + self->ConstructL(aMsgObserver); + CleanupStack::Pop(self); + + PRINT ( _L("End CCsPreviewPluginHandler::NewL") ); + + return self; +} + +// ---------------------------------------------------------------------------- +// CCsPreviewPluginHandler::~CCsPreviewPluginHandler +// Destructor +// ---------------------------------------------------------------------------- +// +CCsPreviewPluginHandler::~CCsPreviewPluginHandler() +{ + PRINT ( _L("Enter CCsPreviewPluginHandler::~CCsPreviewPluginHandler") ); + + iSqlDb.Close(); + iThumbnailRequestArray.Close(); + ifsSession.Close(); + + if (iMmsMtm) + { + delete iMmsMtm; + iMmsMtm = NULL; + } + + if (iMtmRegistry) + { + delete iMtmRegistry; + iMtmRegistry = NULL; + } + + if (iSession) + { + delete iSession; + iSession = NULL; + } + + if (iThumbnailManager) + { + delete iThumbnailManager; + iThumbnailManager = NULL; + } + + PRINT ( _L("End CCsPreviewPluginHandler::~CCsPreviewPluginHandler") ); +} + +// ---------------------------------------------------------------------------- +// CCsMsgHandler::ConstructL +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::ConstructL(CCsPreviewPlugin *aMsgObserver) +{ + PRINT ( _L("Enter CCsPreviewPluginHandler::ConstructL") ); + + iMsgObserver = aMsgObserver; + + //file session connect + User::LeaveIfError(ifsSession.Connect()); + + //create msv session + iSession = CMsvSession::OpenSyncL(*this); + + //create mtm registry + iMtmRegistry = CClientMtmRegistry::NewL(*iSession); + + //create mms client mtm + iMmsMtm = static_cast (iMtmRegistry-> NewMtmL( + KSenduiMtmMmsUid)); + + //create thumbnail manager + iThumbnailManager = CThumbnailManager::NewL(*this); + + // open DB + TInt error = iSqlDb.Open(KDbFileName); + + PRINT1 ( _L("End CCsPreviewPluginHandler::ConstructL open DB file error=%d"), error ); + + // if not found, create DB + if (error == KErrNotFound) + { + //create sqlite-DB + TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysPass); + RSqlSecurityPolicy securityPolicy; + securityPolicy.Create(defaultPolicy); + + // TODO, setting UID security policy + //TSecurityPolicy readPolicy(ECapabilityReadUserData); + //securityPolicy.SetDbPolicy(RSqlSecurityPolicy::EReadPolicy, readPolicy); + + iSqlDb.Create(KDbFileName, securityPolicy); + + //Create the table inside DB + iSqlDb.Exec(KSqlCreateStmt); + iSqlDb.Exec(KEncodingStmnt); + iSqlDb.Exec(KCacheSizeStmnt); + } + else + { + User::LeaveIfError(error); + } + + PRINT ( _L("End CCsPreviewPluginHandler::ConstructL") ); +} + +// ---------------------------------------------------------------------------- +// CCsPreviewPluginHandler::CCsPreviewPluginHandler +// Two Phase Construction +// ---------------------------------------------------------------------------- +// +CCsPreviewPluginHandler::CCsPreviewPluginHandler() +{ +} + +// ---------------------------------------------------------------------------- +// CCsPreviewPluginHandler::HandleSessionEventL +// Implemented for MMsvSessionObserver +// ---------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::HandleSessionEventL(TMsvSessionEvent aEvent, + TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/) +{ + PRINT1 ( _L("Enter CCsPreviewPluginHandler::HandleSessionEventL aEvent=%d"),aEvent ); + + CMsvEntrySelection* selection = NULL; + TMsvId parent; + + //args + if (aArg1 == NULL || aArg2 == NULL) + { + PRINT ( _L("Enter CCsPreviewPluginHandler::HandleSessionEventL arguments invalid")); + return; + } + + //start, processing the event + selection = (CMsvEntrySelection*) aArg1; + parent = *(TMsvId*) aArg2; + + //Drafts not handled + if (KMsvDraftEntryIdValue == parent) + { + return; + } + + switch (aEvent) + { + case EMsvEntriesChanged: + case EMsvEntriesMoved: + { + HandleEventL(selection); + } + break; + + case EMsvEntriesDeleted: + { + for (TInt i = 0; i < selection->Count(); i++) + { + RSqlStatement sqlDeleteStmt; + CleanupClosePushL(sqlDeleteStmt); + sqlDeleteStmt.PrepareL(iSqlDb, KRemoveMsgStmnt); + + TInt messageIdIndex = sqlDeleteStmt.ParameterIndex(_L( + ":message_id")); + User::LeaveIfError(sqlDeleteStmt.BindInt(messageIdIndex, selection->At(i))); + + User::LeaveIfError(sqlDeleteStmt.Exec()); + CleanupStack::PopAndDestroy(&sqlDeleteStmt); + } + } + break; + } + + PRINT ( _L("Exit CCsPreviewPluginHandler::HandleSessionEventL") ); +} + +// --------------------------------------------------------------------- +// CCsPreviewPluginHandler::HandleEvent +// Handle events +// --------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::HandleEventL(CMsvEntrySelection* aSelection) +{ + PRINT ( _L("Enter CCsPreviewPluginHandler::HandleEvent") ); + + TMsvEntry entry; + TMsvId service; + TInt error = KErrNone; + + for (TInt i = 0; i < aSelection->Count(); i++) + { + error = iSession->GetEntry(aSelection->At(i), service, entry); + + if ( (KErrNone == error) && !entry.InPreparation() && entry.Visible() + && (KSenduiMtmMmsUidValue == entry.iMtm.iUid)) + { + PRINT ( _L("Enter CCsPreviewPluginHandler::HandleEvent for loop started.") ); + + TInt msgId = entry.Id(); + + //check if the message is already parsed + RSqlStatement sqlSelectStmt; + CleanupClosePushL(sqlSelectStmt); + sqlSelectStmt.PrepareL(iSqlDb,KSelectMsgParsedStmt); + TInt messageIdIndex = sqlSelectStmt.ParameterIndex( + _L(":message_id")); + + User::LeaveIfError(sqlSelectStmt.BindInt(messageIdIndex, msgId)); + + if (sqlSelectStmt.Next() == KSqlAtRow) + { + TInt parsedColIndex = sqlSelectStmt.ColumnIndex( + _L("msg_parsed")); + TInt msgParsed = sqlSelectStmt.ColumnInt(parsedColIndex); + //if message alresdy parsed, move to next message. + if (msgParsed) + { + CleanupStack::PopAndDestroy(&sqlSelectStmt); + continue; + } + } + CleanupStack::PopAndDestroy(&sqlSelectStmt); + + // update db with message preview data + RSqlStatement sqlInsertStmt; + CleanupClosePushL(sqlInsertStmt); + sqlInsertStmt.PrepareL(iSqlDb, KSqlInsertStmt); + + // parse message + iMmsMtm->SwitchCurrentEntryL(msgId); + iMmsMtm->LoadMessageL(); + + CUniDataModel* iUniDataModel = CUniDataModel::NewL(ifsSession, + *iMmsMtm); + CleanupStack::PushL(iUniDataModel); + iUniDataModel->RestoreL(*this, ETrue); + + //msg property + TInt msgProperty = 0; + if (iUniDataModel->AttachmentList().Count() > 0) + { + msgProperty |= EPreviewAttachment; + } + + TPtrC videoPath; + TPtrC imagePath; + + // preview parsing + TInt slideCount = iUniDataModel->SmilModel().SlideCount(); + TBool isBodyTextSet = EFalse; + TBool isImageSet = EFalse; + TBool isAudioSet = EFalse; + TBool isVideoSet = EFalse; + + for (int i = 0; i < slideCount; i++) + { + int slideobjcount = + iUniDataModel->SmilModel().SlideObjectCount(i); + for (int j = 0; j < slideobjcount; j++) + { + CUniObject *obj = + iUniDataModel->SmilModel(). GetObjectByIndex(i, j); + + TPtrC8 mimetype = obj->MimeType(); + TMsvAttachmentId attachId = obj->AttachmentId(); + + //bodytext + if (!isBodyTextSet && (mimetype.Find(_L8("text")) + != KErrNotFound)) + { + //bind bodytext into statement + BindBodyText(sqlInsertStmt, attachId); + isBodyTextSet = ETrue; + } + + //image parsing + if (!isImageSet && (mimetype.Find(_L8("image")) + != KErrNotFound)) + { + //get thumbnail for this image + GetThumbNailL(attachId, mimetype, msgId); + isImageSet = ETrue; + imagePath.Set(obj->MediaInfo()->FullFilePath()); + msgProperty |= EPreviewImage; + } + + //audio content + if (!isAudioSet && (mimetype.Find(_L8("audio")) + != KErrNotFound)) + { + isAudioSet = ETrue; + msgProperty |= EPreviewAudio; + } + + //video content + if (!isVideoSet && (mimetype.Find(_L8("video")) + != KErrNotFound)) + { + videoPath.Set(obj->MediaInfo()->FullFilePath()); + isVideoSet = ETrue; + msgProperty |= EPreviewVideo; + } + } + } + + //set preview path + TInt previewPathIndex = sqlInsertStmt.ParameterIndex(_L( + ":preview_path")); + if (isVideoSet) + { + User::LeaveIfError(sqlInsertStmt.BindText(previewPathIndex, + videoPath)); + } + else if (isImageSet) + { + User::LeaveIfError(sqlInsertStmt.BindText(previewPathIndex, + imagePath)); + } + + //msg_id + TInt msgIdIndex = sqlInsertStmt.ParameterIndex(_L(":message_id")); + User::LeaveIfError(sqlInsertStmt.BindInt(msgIdIndex, msgId)); + + //subjext + TInt subjectIndex = sqlInsertStmt.ParameterIndex(_L(":subject")); + User::LeaveIfError(sqlInsertStmt.BindText(subjectIndex, + iMmsMtm->SubjectL())); + + //msg_property + TInt msgPropertyIndex = sqlInsertStmt.ParameterIndex(_L( + ":msg_property")); + User::LeaveIfError(sqlInsertStmt.BindInt(msgPropertyIndex, + msgProperty)); + + //msg-parsed + TInt msgParsedIndex = sqlInsertStmt.ParameterIndex( + _L(":msg_parsed")); + User::LeaveIfError(sqlInsertStmt.BindInt(msgParsedIndex, 1)); // 1 as true + + //execute sql stament + User::LeaveIfError(sqlInsertStmt.Exec()); + + //cleanup + CleanupStack::PopAndDestroy(2, &sqlInsertStmt); + } +}//end for loop + +PRINT ( _L("Exit CCsPreviewPluginHandler::HandleEvent") ); +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::RestoreReady() +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::RestoreReady(TInt /*aParseResult*/, TInt /*aError*/) +{ + +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::ThumbnailReady() +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::ThumbnailReady(TInt aError, + MThumbnailData& aThumbnail, TThumbnailRequestId aId) +{ + // This function must not leave. + if (!aError) + { + PRINT ( _L("CCsPreviewPluginHandler::ThumbnailReady received.") ); + TInt err; + TRAP(err, HandleThumbnailReadyL(aThumbnail, aId)); + PRINT1 ( _L("CCsPreviewPluginHandler::ThumbnailReady handling error= %d."), err ); + } + else + { + // An error occurred while getting the thumbnail. + PRINT1 ( _L("End CCsPreviewPluginHandler::ThumbnailReady error= %d."), aError ); + } +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::ThumbnailPreviewReady() +// callback +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::ThumbnailPreviewReady( + MThumbnailData& /*aThumbnail*/, TThumbnailRequestId /*aId*/) +{ + +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::HandleThumbnailReadyL() +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::HandleThumbnailReadyL(MThumbnailData& aThumbnail, + TThumbnailRequestId aId) +{ + //match response to request + ThumbnailRequestData tempObj; + tempObj.iRequestId = aId; + + TInt index = iThumbnailRequestArray.Find(tempObj, + CCsPreviewPluginHandler::CompareByRequestId); + if (index < 0) + { + PRINT ( _L("End CCsPreviewPluginHandler::HandleThumbnailReady request match not found.") ); + return; + } + + // get msg-id corresponding to the request-id + TInt msgId = iThumbnailRequestArray[index].iMsgId; + //remove the request from requestarray + iThumbnailRequestArray.Remove(index); + + // get bitmap + CFbsBitmap* bitmap = aThumbnail.Bitmap(); + + // sql-statment to set preview-icon + RSqlStatement sqlInsertStmt; + CleanupClosePushL(sqlInsertStmt); + sqlInsertStmt.PrepareL(iSqlDb, KSqlUpdateBitmapStmt); + + TInt msgIdIndex = sqlInsertStmt.ParameterIndex(_L(":message_id")); + TInt previewIconIndex = sqlInsertStmt.ParameterIndex(_L(":preview_icon")); + + User::LeaveIfError(sqlInsertStmt.BindInt(msgIdIndex, msgId)); + + RSqlParamWriteStream previewIconStream; + CleanupClosePushL(previewIconStream); + + //bind data + User::LeaveIfError(previewIconStream.BindBinary(sqlInsertStmt, previewIconIndex)); + bitmap->ExternalizeL(previewIconStream); + previewIconStream.CommitL(); + + //execute the statent + User::LeaveIfError(sqlInsertStmt.Exec()); + + CleanupStack::PopAndDestroy(2,&sqlInsertStmt);//sqlInsertStmt,previewIconStream +} + +//----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::CompareByRequestId +// Compare to conversation entry object based on Entry Ids +//---------------------------------------------------------------------------- +TBool CCsPreviewPluginHandler::CompareByRequestId( + const ThumbnailRequestData& aFirst, const ThumbnailRequestData& aSecond) +{ + if (aFirst.iRequestId == aSecond.iRequestId) + return ETrue; + + return EFalse; +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::BindBodyText() +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::BindBodyText(RSqlStatement& sqlStmt, + TMsvAttachmentId attachmentId) +{ + //get file handle from attachmnet manager. + CMsvStore * store = iMmsMtm->Entry().ReadStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + RFile file = attachMan.GetAttachmentFileL(attachmentId); + CleanupClosePushL(file); + + //read file contents to buffer + TInt length; + file.Size(length); + HBufC8* bodyText = HBufC8::NewLC(length); + TPtr8 textBuffer = bodyText->Des(); + file.Read(textBuffer); + + // convert from HBufC8 to HBufC16 + HBufC16 *text16 = HBufC16::NewLC(textBuffer.Length()); + TPtr16 textPtr16 = text16->Des(); + CnvUtfConverter::ConvertToUnicodeFromUtf8(textPtr16, textBuffer); + + //set bodytext in the sql statement + TInt bodyTextIndex = sqlStmt.ParameterIndex(_L(":body_text")); + sqlStmt.BindText(bodyTextIndex, textPtr16); + + CleanupStack::PopAndDestroy(4, store); //store,file, bodyText, text16 +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::GetThumbNailL() +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::GetThumbNailL(TMsvAttachmentId attachmentId, + TDesC8& mimeType, TMsvId msgId) +{ + //Scale the image + iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio); + // Preferred size is 100x100 (or less) + iThumbnailManager->SetThumbnailSizeL(TSize(100, 100)); + //optimize for performace + iThumbnailManager->SetQualityPreferenceL( + CThumbnailManager::EOptimizeForPerformance); + + // Create Thumbnail object source representing a path to a file + HBufC* mimeInfo = HBufC::NewLC(mimeType.Length()); + mimeInfo->Des().Copy(mimeType); + + CMsvStore * store = iMmsMtm->Entry().ReadStoreL(); + CleanupStack::PushL(store); + + //get file handle from attachment manager. + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + RFile file = attachMan.GetAttachmentFileL(attachmentId); + CleanupClosePushL(file); + + CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( + (RFile64&) file, mimeInfo->Des()); + + // Issue the request for thumbnail creation + ThumbnailRequestData reqObject; + reqObject.iMsgId = msgId; + reqObject.iRequestId = iThumbnailManager->GetThumbnailL(*source); + iThumbnailRequestArray.Append(reqObject); + + CleanupStack::PopAndDestroy(4, mimeInfo);//mimeInfo,store,file,source +} + +// End of file + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/plugins/previewplugin/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/previewplugin/src/proxy.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 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: ECOM Plugin proxy details + * +*/ + + +// INCLUDES +#include +#include +#include "ccspreviewplugin.h" + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(0x20024329, CCsPreviewPlugin::NewL ) //temp Uid +}; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h --- a/messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h Fri May 14 15:49:35 2010 +0300 @@ -25,7 +25,6 @@ class MMsvSessionObserver; class CConversationCache; class CCsConversationEntry; -class MCsConversationDeleteObserver; /** * Delete handler states @@ -48,8 +47,7 @@ /** * Two phase construction */ - static CCsConversationDeleteHandler* NewL(CCsConversationCache* aCache, - MCsConversationDeleteObserver* aObserver); + static CCsConversationDeleteHandler* NewL(CCsConversationCache* aCache); /** * Destructor @@ -74,8 +72,7 @@ private: CCsConversationDeleteHandler(); - void ConstructL(CCsConversationCache* aCache, - MCsConversationDeleteObserver* aObserver); + void ConstructL(CCsConversationCache* aCache); void IssueRequest(); void DeleteOneMessage(); @@ -86,13 +83,6 @@ CMsvSession* iSession; /** - * iObserverList - * List of observers - * Own. - */ - MCsConversationDeleteObserver* iObserver; - - /** * State */ TDeleteHandlerState iState; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h --- a/messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h Fri May 14 15:49:35 2010 +0300 @@ -22,11 +22,9 @@ // FORWARD DECLARATIONS class CMsvSession; -class MMsvSessionObserver; class CConversationCache; class CCsConversationEntry; -class MCsConversationMarkReadObserver; - +class MMsvSessionObserver; /** * Mark read handler states */ @@ -41,15 +39,13 @@ /** * This class handles mark read of messages from messaging store. */ -class CCsConversationMarkReadHandler : public CActive, -public MMsvSessionObserver - { +class CCsConversationMarkReadHandler : public CActive, public MMsvSessionObserver +{ public: /** * Two phase construction */ - static CCsConversationMarkReadHandler* NewL(CCsConversationCache* aCache, - MCsConversationMarkReadObserver* aObserver); + static CCsConversationMarkReadHandler* NewL(CCsConversationCache* aCache); /** * Destructor @@ -75,8 +71,7 @@ private: CCsConversationMarkReadHandler(); - void ConstructL(CCsConversationCache* aCache, - MCsConversationMarkReadObserver* aObserver); + void ConstructL(CCsConversationCache* aCache); void IssueRequest(); void MarkReadOneMessageL(); @@ -87,12 +82,6 @@ CMsvSession* iSession; /** - * iObserver - * Own. - */ - MCsConversationMarkReadObserver* iObserver; - - /** * State */ TMarkReadHandlerState iState; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/inc/ccssession.h --- a/messagingapp/msgappfw/server/inc/ccssession.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/inc/ccssession.h Fri May 14 15:49:35 2010 +0300 @@ -18,17 +18,11 @@ #ifndef __C_CS_SESSION_H #define __C_CS_SESSION_H -// USER INCLUDE FILES -#include "mcsconversationdeleteobserver.h" -#include "mcsconversationmarkreadobserver.h" - // FORWARD DECLARATIONS class CCsServer; class CCsPluginInterface; class CCsClientConversation; class CCsConversationEvent; -class CCsConversationDeleteHandler; -class CCsConversationMarkReadHandler; // CLASS DECLARATIONS @@ -36,9 +30,7 @@ * Represents a session (version 2) for a client thread on * the server side */ -class CCsSession : public CSession2, -public MCsConversationDeleteObserver, -public MCsConversationMarkReadObserver +class CCsSession : public CSession2 { public: @@ -152,15 +144,7 @@ */ void HandleRefreshConversationL(); -public: - // From MCsConversationDeleteObserver - void DeleteComplete(CCsConversationDeleteHandler* aHandler); - void DeleteInProgress(CCsConversationDeleteHandler* aHandler); - -public: - // From MCsConversationMarkReadObserver - void MarkReadComplete(CCsConversationMarkReadHandler* aHandler); - + private: /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/inc/mcsconversationdeleteobserver.h --- a/messagingapp/msgappfw/server/inc/mcsconversationdeleteobserver.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2007 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: Conversation delete observer interface. - * -*/ - -#ifndef MCSCONVERSATIONDELETEOBSERVER_H_ -#define MCSCONVERSATIONDELETEOBSERVER_H_ - -class CCsConversationDeleteHandler; - -class MCsConversationDeleteObserver - { -public: - /** - * Callback that notifies delete is already in progress - */ - virtual void DeleteInProgress(CCsConversationDeleteHandler* handler) = 0; - - /** - * Callback that notifies delete is complete - */ - virtual void DeleteComplete(CCsConversationDeleteHandler* handler) = 0; - }; - -#endif /* MCSCONVERSATIONDELETEOBSERVER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/inc/mcsconversationmarkreadobserver.h --- a/messagingapp/msgappfw/server/inc/mcsconversationmarkreadobserver.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2007 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: Conversation mark read observer interface. - * -*/ - -#ifndef MCSCONVERSATIONREADOBSERVER_H_ -#define MCSCONVERSATIONREADOBSERVER_H_ - -class CCsConversationMarkReadHandler; - -class MCsConversationMarkReadObserver - { -public: - /** - * Callback that notifies mark read is complete - */ - virtual void MarkReadComplete(CCsConversationMarkReadHandler* handler) = 0; - }; - -#endif /* MCSCONVERSATIONREADOBSERVER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/src/ccscontactsresolver.cpp --- a/messagingapp/msgappfw/server/src/ccscontactsresolver.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/src/ccscontactsresolver.cpp Fri May 14 15:49:35 2010 +0300 @@ -58,11 +58,7 @@ phoneFilter.setValue(address); phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); - QList sortOrder; - QList matchingContacts = mPhonebookManager->contacts( - phoneFilter, - sortOrder, - QStringList()); + QList matchingContacts = mPhonebookManager->contacts(phoneFilter); if ( matchingContacts.count() > 0 ) { QContact match = matchingContacts.at(0); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp --- a/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -19,19 +19,18 @@ #include #include "ccsconversationcache.h" #include "ccsconversationdeletehandler.h" -#include "mcsconversationdeleteobserver.h" // ---------------------------------------------------------------------------- // CCsConversationDeleteHandler::NewL // Two Phase Construction // ---------------------------------------------------------------------------- CCsConversationDeleteHandler* CCsConversationDeleteHandler:: -NewL(CCsConversationCache* aCache, MCsConversationDeleteObserver* aObserver) +NewL(CCsConversationCache* aCache) { CCsConversationDeleteHandler* self = new (ELeave) CCsConversationDeleteHandler(); CleanupStack::PushL(self); - self->ConstructL(aCache, aObserver); + self->ConstructL(aCache); CleanupStack::Pop(self); // self return self; } @@ -48,13 +47,11 @@ // ---------------------------------------------------------------------------- // Constructor // ---------------------------------------------------------------------------- -void CCsConversationDeleteHandler::ConstructL(CCsConversationCache* aCache, - MCsConversationDeleteObserver* aObserver) +void CCsConversationDeleteHandler::ConstructL(CCsConversationCache* aCache) { iCache = aCache; iState = EIdle; - iObserver = aObserver; - + iConversationEntryList = new (ELeave)RPointerArray (); iSession = CMsvSession::OpenSyncL(*this); } @@ -63,9 +60,17 @@ // Destructor // ---------------------------------------------------------------------------- CCsConversationDeleteHandler::~CCsConversationDeleteHandler() +{ + if (iConversationEntryList) { - if(iSession) - { + iConversationEntryList->ResetAndDestroy(); + iConversationEntryList->Close(); + delete iConversationEntryList; + iConversationEntryList = NULL; + } + + if (iSession) + { delete iSession; iSession = NULL; } @@ -79,7 +84,8 @@ // Check if delete in progress if ( iCache->IsDeleted(aConversationId) ) { - iObserver->DeleteInProgress(this); + // Deletion is in progress for this conversation, so clean up this AO + delete this; return; } @@ -90,10 +96,7 @@ CCsClientConversation* clientConversation = CCsClientConversation::NewL(); clientConversation->SetConversationEntryId(iConversationId); CleanupStack::PushL(clientConversation); - - // Create entry list - iConversationEntryList = new (ELeave)RPointerArray (); - + // Get conversationlist for given client conversation iCache->GetConversationsL (clientConversation, iConversationEntryList); iCache->MarkConversationAsDeleted(iConversationId, ETrue); @@ -162,15 +165,9 @@ case EDeleteComplete: // Mark delete complete. iCache->MarkConversationAsDeleted(iConversationId, EFalse); - // Cleanup - iDeletedCount = 0; - iConversationEntryList->ResetAndDestroy(); - iConversationEntryList->Close(); - delete iConversationEntryList; - iConversationEntryList = NULL; - - // Notify observers - iObserver->DeleteComplete(this); + // Done with the processing , cleanup the AO since this is the last + //call to the delete handler. + delete this; break; } } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp --- a/messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -19,7 +19,6 @@ #include #include "ccsconversationcache.h" #include "ccsconversationmarkreadhandler.h" -#include "mcsconversationmarkreadobserver.h" #include // ---------------------------------------------------------------------------- @@ -27,12 +26,12 @@ // Two Phase Construction // ---------------------------------------------------------------------------- CCsConversationMarkReadHandler* CCsConversationMarkReadHandler:: -NewL(CCsConversationCache* aCache, MCsConversationMarkReadObserver* aObserver) +NewL(CCsConversationCache* aCache) { CCsConversationMarkReadHandler* self = new (ELeave) CCsConversationMarkReadHandler(); CleanupStack::PushL(self); - self->ConstructL(aCache, aObserver); + self->ConstructL(aCache); CleanupStack::Pop(self); // self return self; } @@ -49,13 +48,11 @@ // ---------------------------------------------------------------------------- // Constructor // ---------------------------------------------------------------------------- -void CCsConversationMarkReadHandler::ConstructL(CCsConversationCache* aCache, - MCsConversationMarkReadObserver* aObserver) +void CCsConversationMarkReadHandler::ConstructL(CCsConversationCache* aCache) { iCache = aCache; iState = EMarkReadIdle; - iObserver = aObserver; - + iConversationEntryList = new (ELeave)RPointerArray (); iSession = CMsvSession::OpenSyncL(*this); } @@ -64,9 +61,19 @@ // Destructor // ---------------------------------------------------------------------------- CCsConversationMarkReadHandler::~CCsConversationMarkReadHandler() +{ + Cancel(); + if (iConversationEntryList) { - if(iSession) - { + iConversationEntryList->ResetAndDestroy(); + iConversationEntryList->Close(); + delete iConversationEntryList; + iConversationEntryList = NULL; + + } + + if (iSession) + { delete iSession; iSession = NULL; } @@ -81,10 +88,7 @@ CCsClientConversation* clientConversation = CCsClientConversation::NewL(); clientConversation->SetConversationEntryId(aConversationId); CleanupStack::PushL(clientConversation); - - // Create entry list - iConversationEntryList = new (ELeave)RPointerArray (); - + // Get conversationlist for given client conversation iCache->GetConversationsL (clientConversation, iConversationEntryList); @@ -123,8 +127,8 @@ if(entry.iMtm != KUidMsgTypeMultimedia) { entry.SetUnread( EFalse ); + cEntry->ChangeL( entry ); } - cEntry->ChangeL( entry ); } CleanupStack::PopAndDestroy(cEntry); } @@ -167,30 +171,17 @@ break; case EMarkReadComplete: - // Cleanup - iMarkReadCount = 0; - iConversationEntryList->ResetAndDestroy(); - iConversationEntryList->Close(); - delete iConversationEntryList; - iConversationEntryList = NULL; - - // Notify observers - iObserver->MarkReadComplete(this); + // Cleanup, this is the last call RunL is not activated again. + delete this; break; } } TInt CCsConversationMarkReadHandler::RunError(TInt aError) { - iMarkReadCount = 0; - iConversationEntryList->ResetAndDestroy(); - iConversationEntryList->Close(); - delete iConversationEntryList; - iConversationEntryList = NULL; - - // Notify observer - iObserver->MarkReadComplete(this); - return KErrNone; + // RunL left so stop processing the AO and clean it. + delete this; + return KErrNone; } // ---------------------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgappfw/server/src/ccssession.cpp --- a/messagingapp/msgappfw/server/src/ccssession.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgappfw/server/src/ccssession.cpp Fri May 14 15:49:35 2010 +0300 @@ -1303,7 +1303,7 @@ // Delete handler CCsConversationCache* cache = iServer->ConversationCacheInterface(); CCsConversationDeleteHandler* deleteHandler = - CCsConversationDeleteHandler::NewL(cache, this); + CCsConversationDeleteHandler::NewL(cache); deleteHandler->DeleteL(conversationId); aMessage.Complete(EUserDeleteConversationComplete); @@ -1312,22 +1312,6 @@ } // ---------------------------------------------------------------------------- -// CCsSession::DeleteComplete -// ---------------------------------------------------------------------------- -void CCsSession::DeleteComplete(CCsConversationDeleteHandler* aHandler) -{ - delete aHandler; -} - -// ---------------------------------------------------------------------------- -// CCsSession::DeleteInProgress -// ---------------------------------------------------------------------------- -void CCsSession::DeleteInProgress(CCsConversationDeleteHandler* aHandler) -{ - delete aHandler; -} - -// ---------------------------------------------------------------------------- // CCsSession::HandleRefreshConversationListL // ---------------------------------------------------------------------------- void CCsSession::HandleRefreshConversationListL() @@ -1521,8 +1505,7 @@ // Mark read handler CCsConversationCache* cache = iServer->ConversationCacheInterface(); - CCsConversationMarkReadHandler* markHandler = - CCsConversationMarkReadHandler::NewL(cache, this); + CCsConversationMarkReadHandler* markHandler = CCsConversationMarkReadHandler::NewL(cache); markHandler->MarkReadL(conversationId); @@ -1530,13 +1513,4 @@ PRINT ( _L("End CCsSession::MarkConversationReadL") ); } - -// ---------------------------------------------------------------------------- -// CCsSession::MarkReadComplete -// ---------------------------------------------------------------------------- -void CCsSession::MarkReadComplete(CCsConversationMarkReadHandler* aHandler) -{ - delete aHandler; -} - //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp --- a/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp Fri May 14 15:49:35 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include #define LOC_VIEW hbTrId("txt_messaging_button_view") #define LOC_CANCEL hbTrId("txt_common_button_cancel") @@ -79,19 +80,19 @@ messageBox.setTimeout(HbPopup::NoTimeout); messageBox.setText(errorNote); - HbAction* actionView = new HbAction(LOC_VIEW); - messageBox.setPrimaryAction(actionView); + QAction* actionView = new QAction(LOC_VIEW,this); + messageBox.setAction(actionView,HbDeviceMessageBox::AcceptButtonRole); - HbAction* actionQuit = new HbAction(LOC_CANCEL); - actionQuit->setCommandRole(HbAction::QuitRole); - messageBox.setSecondaryAction(actionQuit); + QAction* actionQuit = new QAction(LOC_CANCEL,this); + actionQuit->setMenuRole(QAction::QuitRole); + messageBox.setAction(actionView,HbDeviceMessageBox::RejectButtonRole); setCurrentRequestAsync(); - HbAction* result = messageBox.exec(); + const QAction* result = messageBox.exec(); // TODO: use XQAiwrequest - if (result->commandRole() != HbAction::QuitRole) { + if (result->menuRole() != QAction::QuitRole) { QList args; QString serviceName("com.nokia.services.hbserviceprovider"); QString operation("open(qint64)"); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h --- a/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h Fri May 14 15:49:35 2010 +0300 @@ -54,7 +54,7 @@ * @see HbIndicatorPluginInterface */ bool accessAllowed(const QString &indicatorType, - const HbSecurityInfo *securityInfo) const; + const QVariantMap& securityInfo) const; /** * @see HbIndicatorPluginInterface */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp --- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp Fri May 14 15:49:35 2010 +0300 @@ -116,7 +116,7 @@ // @see msgindicator.h // ---------------------------------------------------------------------------- MsgIndicator::MsgIndicator(const QString &indicatorType) : - HbIndicatorInterface(indicatorType, HbIndicatorInterface::GroupPriorityHigh, + HbIndicatorInterface(indicatorType, HbIndicatorInterface::NotificationCategory, InteractionActivated), mIndicatorType(NULL) { @@ -165,8 +165,18 @@ } case DecorationNameRole: { - return IndicatorInfo[mIndicatorType].icon; - + return IndicatorInfo[mIndicatorType].icon; + } + case MonoDecorationNameRole: + { + if (NewIndicatorPlugin == mIndicatorType) { + return IndicatorInfo[mIndicatorType].icon; + } + else { + // Don't show status-bar icons for indications other + // than new-message + return QVariant(); + } } default: return QVariant(); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp --- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -134,7 +134,7 @@ indicatorData.mDescription = nameList.join(QString(", ")); indicatorData.mMessageType = ECsSMS; } - else{ + else if (nameList.count() == 1){ // only 1 sender. // displayname will have the name of the sender. // description will contain latest message if more than 1 message diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp --- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp Fri May 14 15:49:35 2010 +0300 @@ -23,7 +23,6 @@ #include #include -Q_EXPORT_PLUGIN(MsgIndicatorPlugin) // ---------------------------------------------------------------------------- // MsgIndicatorPlugin::MsgIndicatorPlugin @@ -62,7 +61,7 @@ // @see msgindicatorplugin.h // ---------------------------------------------------------------------------- bool MsgIndicatorPlugin::accessAllowed(const QString &indicatorType, - const HbSecurityInfo *securityInfo) const + const QVariantMap& securityInfo) const { Q_UNUSED(indicatorType) Q_UNUSED(securityInfo) @@ -109,3 +108,5 @@ } return -1; } + +Q_EXPORT_PLUGIN2(msgindicatorplugin,MsgIndicatorPlugin) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp --- a/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -247,7 +247,8 @@ void MsgNotificationDialogWidget::widgetActivated() { QThreadPool::globalInstance()->start( - new ServiceRequestSenderTask(mConversationId)); + new ServiceRequestSenderTask(mConversationId)); + enableTouchActivation(false); } // ---------------------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h --- a/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h Fri May 14 15:49:35 2010 +0300 @@ -25,6 +25,8 @@ class MsgNotifier; class CCSRequestHandler; class MsgStoreHandler; +class XQSettingsManager; +class XQPublishAndSubscribeUtils; /** * @class MsgNotifierPrivate @@ -124,7 +126,14 @@ * @param bootup, true, if called on bootup else false */ void updateUnreadIndications(bool bootup = false); - + + /** + * Show notification or not + * @param receivedMsgConvId received message conversation id. + * @return true if the received conversation id is not same as + * published conversation id ( opened conversation id) else false + */ + bool showNotification(int receivedMsgConvId); private: /** @@ -141,6 +150,18 @@ * Pointer to Conversation Msg Store Handler. */ MsgStoreHandler* iMsgStoreHandler; + + /** + * Settings manager + * Owned. + */ + XQSettingsManager* mSettingsManager; + + /** + * Publish and subscribe utils. + * Owned. + */ + XQPublishAndSubscribeUtils* mPSUtils; }; #endif // MSGNOTIFIER_PRIVATE_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotifier/msgnotifier.pro --- a/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro Fri May 14 15:49:35 2010 +0300 @@ -66,5 +66,7 @@ -lxqservice \ -lQtContacts \ -lQtVersit \ - -lunidatamodelloader + -lunidatamodelloader \ + -lxqsettingsmanager \ + -apgrfx.lib diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp Fri May 14 15:49:35 2010 +0300 @@ -20,10 +20,7 @@ #include #include #include -#include -#include -#include -QTM_USE_NAMESPACE + //USER INCLUDES #include "msgnotifier.h" #include "msgnotifier_p.h" @@ -33,6 +30,8 @@ #include "ccsdefs.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" +#include "msgcontacthandler.h" + #include "debugtraces.h" // LOCALIZATION CONSTANTS @@ -114,7 +113,8 @@ QString attachmentPath = attList[0]->path(); description = LOC_BUSINESS_CARD; description.append(CARD_SEPERATOR); - description.append(getVcardDisplayName(attachmentPath)); + description.append( + MsgContactHandler::getVCardDisplayName(attachmentPath)); } delete pluginLoader; } @@ -197,39 +197,4 @@ QDEBUG_WRITE("MsgNotifier::updateOutboxIndications Exit") } -//--------------------------------------------------------------- -// MsgNotifier::getVcardDisplayName -// @see header -//--------------------------------------------------------------- -QString MsgNotifier::getVcardDisplayName(const QString& filePath) -{ - QString displayName; - //open file for parsing - QFile file(filePath); - if (!file.open(QIODevice::ReadOnly)) { - return displayName; - } - // parse contents - QVersitReader reader; - reader.setDevice(&file); - if (reader.startReading()) { - if (reader.waitForFinished()) { - QList versitDocuments = reader.results(); - // Use the resulting document - if (versitDocuments.count() > 0) { - QVersitContactImporter importer; - QList contacts = importer.importContacts(versitDocuments); - // get display-name - if (contacts.count() > 0) { - QContactManager* contactManager = new QContactManager("symbian"); - displayName = contactManager->synthesizedDisplayLabel(contacts[0]); - delete contactManager; - } - } - } - } - file.close(); - return displayName; -} - //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -23,6 +23,10 @@ #include #include #include +#include +#include +#include +#include //USER INCLUDES #include "msgnotifier.h" @@ -30,19 +34,17 @@ #include "s60qconversions.h" #include "msgstorehandler.h" #include "msginfodefs.h" -#include +#include "conversationidpsconsts.h" +#include "debugtraces.h" -#define QDEBUG_WRITE(str) {qDebug() << str;} -#define QDEBUG_WRITE_FORMAT(str, val) {qDebug() << str << val;} -#define QCRITICAL_WRITE(str) {qCritical() << str;} -#define QCRITICAL_WRITE_FORMAT(str, val) {qCritical() << str << val;} // ---------------------------------------------------------------------------- // MsgNotifierPrivate::MsgNotifierPrivate // @see MsgNotifierPrivate.h // ---------------------------------------------------------------------------- MsgNotifierPrivate::MsgNotifierPrivate(MsgNotifier* MsgNotifier) : - q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL) + q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL), + mSettingsManager(NULL),mPSUtils(NULL) { QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter") @@ -67,6 +69,17 @@ delete iMsgStoreHandler; iMsgStoreHandler = NULL; } + + if(mPSUtils) + { + delete mPSUtils; + } + + if(mSettingsManager) + { + delete mSettingsManager; + } + QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit") } @@ -84,6 +97,24 @@ updateUnreadIndications(true); updateOutboxIndications(); + mSettingsManager = new XQSettingsManager(); + + // define property + mPSUtils = new XQPublishAndSubscribeUtils(*mSettingsManager); + XQPublishAndSubscribeSettingsKey convIdKey( + KMsgCVIdProperty, KMsgCVIdKey); + bool success = mPSUtils->defineProperty(convIdKey, + XQSettingsManager::TypeInt); + + QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL " + "property creation ret value",success) + + // write -1 initially + success = mSettingsManager->writeItemValue(convIdKey,-1); + + QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL " + "writing ret value",success) + QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit") } @@ -185,9 +216,14 @@ notifData.mDescription = S60QConversions::s60DescToQString(*descrp); } - q_ptr->displayNewMessageNotification(notifData); - - QDEBUG_WRITE("processListEntry : Notification display called") + // check whether opened cv id and received + // cv id are same and show notification + if( showNotification(notifData.mConversationId )) + { + q_ptr->displayNewMessageNotification(notifData); + QDEBUG_WRITE("processListEntry : Notification display called") + } + } QDEBUG_WRITE("MsgNotifierPrivate::processListEntry : Exit") @@ -287,4 +323,44 @@ } +// ---------------------------------------------------------------------------- +// MsgNotifierPrivate::showNotification +// @see MsgNotifierPrivate.h +// ---------------------------------------------------------------------------- +bool MsgNotifierPrivate::showNotification(int receivedMsgConvId) +{ + bool showNotification = true; + + RWsSession wsSession ; + wsSession.Connect(); + + TApaTaskList taskList( wsSession ); + TApaTask task = taskList.FindApp(KMsgAppUid); // find msgapp is running + + if(task.Exists()) + { + TApaTask foregndtask = taskList.FindByPos(0) ; // foreground app + // compare window group id + // if application is in foregorund, then check the currently + // opened conversation is same as received one. + if(task.WgId() == foregndtask.WgId() ) + { + // get the current conversation ID + XQPublishAndSubscribeSettingsKey convIdKey( KMsgCVIdProperty, + KMsgCVIdKey); + QVariant value = mSettingsManager->readItemValue(convIdKey, + XQSettingsManager::TypeInt); + + int openedConvId = value.toInt(); + if( openedConvId == receivedMsgConvId) + { + showNotification = false; + QDEBUG_WRITE("processListEntry : Notification not shown") + } + } + } + + wsSession.Close(); + return showNotification; +} //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgsendinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgsendinterface.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Message send service interface used for interfacing between + * QT highway and other applications. + * + */ + +#ifndef MSGSENDINTERFACE_H_ +#define MSGSENDINTERFACE_H_ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MsgServiceViewManager; + +class MsgSendInterface : public XQServiceProvider + { + Q_OBJECT + +public: + /* + * Constructor + */ + MsgSendInterface(MsgServiceViewManager* viewManager); + + /* + * Destructor + */ + ~MsgSendInterface(); + +public slots: + + /** + * Send message. + * @param phoneNumber phone number. + * @param contactId contactId. + * @param displayName display name. + */ + void send(const QString phoneNumber, const qint32 contactId, + const QString displayName); + + /** + * Send message. + * @param phoneNumber phone number. + * @param alias alias name. + * @param bodyText body text. + */ + void send(const QString phoneNumber, const QString alias, + const QString bodyText); + +private: + + /** + * Pointer to view manager + * Not owned. + */ + MsgServiceViewManager* mViewManager; + }; + + +#endif /* MSGSENDINTERFACE_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,190 @@ +/* + * 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: Manages differnt messaging views. + * + * + */ + +#ifndef MSGSERVICEVIEWMANAGER_H_ +#define MSGSERVICEVIEWMANAGER_H_ + +#include +#include + +class HbMainWindow; +class MsgUnifiedEditorView; +class UnifiedViewer; +class MsgBaseView; +class MsgSettingsView; +class HbAction; +class MsgStoreHandler; + +class MsgServiceViewManager: public QObject +{ +Q_OBJECT + +public: + /** + * Constructor + */ + MsgServiceViewManager(MsgStoreHandler* storeHandler, + HbMainWindow* mainWindow, QObject* parent = 0); + + /** + * Destructor. + */ + ~MsgServiceViewManager(); + + /** + * Send message. + * @param phoneNumber phone number. + * @param contactId contactId. + * @param displayName displayname. + */ + void send(const QString phoneNumber, + const qint32 contactId, + const QString displayName); + + /** + * Send message. + * @param phoneNumber phone number. + * @param alias alias. + * @param bodyText body text. + */ + void send(const QString phoneNumber, + const QString alias, + const QString bodyText); + + /** + * Send message. + * @param data data to be sent. + */ + void send(QVariant data); + + /** + * Opens the viewer to view the message. + * @param msgId message id of the message. + */ + void view(int msgId); + +private: + /* + * Switch to unieditor. + * @param editorData editor data. + */ + void switchToUniEditor(const QVariantList& editorData); + + /* + * Switch to settings view. + */ + void switchToMsgSettings(const QVariantList& data); + + /** + * Handle sms and mms messge + * @param msgId message id + */ + void handleSmsMmsMsg(int msgId); + + /** + * Handle ringtone message + * @param msgId message id + */ + void handleRingtoneMsg(int msgId); + + /** + * Handle provisioning message + * @param msgId message id + */ + void handleProvisoningMsg(int msgId); + + /** + * Handle bluetooth message + * @param msgId message id + */ + void handleBTMessage(int msgId); + +private slots: + /** + * This slot is called on mainwindows back action. + */ + void onBackAction(); + + /** + * This slot is called when switchView signal is emitted from a view. + * @param data data required to switch the views. + */ + void switchView(const QVariantList& data); + + /** + * This slot is called delete message dialog launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsg(HbAction* action); + + /** + * This slot is called save tone dialog launched. + * @param action selected action (yes or no) + */ + void onDialogSaveTone(HbAction* action); + +private: + /** + * Main window pointer. + * Not owned. + */ + HbMainWindow* mMainWindow; + + /** + * Unified editor. + * Owned. + */ + MsgUnifiedEditorView* mUniEditor; + + /** + * Unified viewer. + * Owned. + */ + UnifiedViewer* mUniViewer; + + /** + * Settings view. + * Owned. + */ + MsgSettingsView* mSettingsView; + + /** + * Back action + * Owned. + */ + HbAction* mBackAction; + + /** + * Store handler. + * Not Owned. + */ + MsgStoreHandler* mStoreHandler; + + /** + * Current view value. + */ + int mCurrentView; + + /** + * message Id + */ + int mMessageId; + +}; + +#endif /* MSGSERVICEVIEWMANAGER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgservicewindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgservicewindow.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Message service application main window. + * + */ + +#ifndef __MSG_SERVICE_WINDOW_H__ +#define __MSG_SERVICE_WINDOW_H__ + +#include + +// FORWARD DECLARATIONS +class MsgViewInterface; +class MsgStoreHandler; +class MsgServiceViewManager; +class MsgShareUiInterface; +class MsgSendInterface; + +class MsgServiceWindow : public HbMainWindow + { + Q_OBJECT + +public: + /** + * Constructor + */ + MsgServiceWindow(); + + /** + * Destructor + */ + ~MsgServiceWindow(); + +private: + /** + * View interface object + * Owned + */ + MsgSendInterface* mSendInterface; + + /** + * View interface object + * Owned + */ + MsgViewInterface* mViewInterface; + + /** + * View interface object + * Owned + */ + MsgShareUiInterface* mShareUiInterface; + + /** + * Message store handler + * Owned. + */ + MsgStoreHandler* mStoreHandler; + + /** + * View manager + * Owned. + */ + MsgServiceViewManager* mViewManager; + + }; + +#endif // __MSG_SERVICE_WINDOW_H__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgshareuiinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgshareuiinterface.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,58 @@ +/* + * 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: Message share UI service interface used for interfacing between + * QT highway and other applications. + * + */ + +#ifndef MSGSHAREUIINTERFACE_H_ +#define MSGSHAREUIINTERFACE_H_ + +// INCLUDES +#include +#include + +class MsgServiceViewManager; +class MsgShareUiInterface : public XQServiceProvider + { + Q_OBJECT + +public: + /* + * Constructor + */ + MsgShareUiInterface(MsgServiceViewManager* viewManager); + + /* + * Destructor + */ + ~MsgShareUiInterface(); + +public slots: + /** + * Send message. + * @param data data to be sent. + */ + void send(QVariant data); + +private: + /** + * Pointer to view manager + * Not owned. + */ + MsgServiceViewManager* mViewManager; + }; + + +#endif /* MSGSHAREUIINTERFACE_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgstorehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgstorehandler.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008 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: Reads message information from message store. +* +*/ + +#ifndef __MSG_STORE_HANDLER_H__ +#define __MSG_STORE_HANDLER_H__ + +// INCLUDE FILES +#include + +class MsgStoreHandler : public MMsvSessionObserver + { +public: + /** + * Constructor + */ + explicit MsgStoreHandler(); + + /** + * Destructor + */ + virtual ~MsgStoreHandler(); + +public : + /** + * @see MMsvSessionObserver + */ + void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, + TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/); + +public: + /** + * Mark message as read and get the message type + * @param messageId message Id + * @param msgType message type is written to this. + * @param msgType message sub type is written to this. + */ + void markAsReadAndGetType(int msgId, + int& msgType, + int& msgSubType); + + /** + * Delete message. + * @param msgId id of the message to be deleted. + */ + void deleteMessage(int msgId); + +private: + /** + * Does all initilaizations + */ + void InitL(); + + /** + * Extrcats the message type from TMsvEntry + * @param aEntry message entry. + * @param msgType message type is written to this. + * @param msgType message sub type is written to this. + */ + void extractMsgType(const TMsvEntry& aEntry, + int& msgType, + int& msgSubType); + +private: + /** + * Session + * Owned. + */ + CMsvSession* iMsvSession; + }; + +#endif // __MSG_STORE_HANDLER_H__ + +// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/inc/msgviewinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/inc/msgviewinterface.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Message view service interface used for interfacing between + * QT highway and other applications. + * + */ + +#ifndef __MSG_VIEW_INTERFACE_H__ +#define __MSG_VIEW_INTERFACE_H__ + +#include +#include + +class MsgServiceViewManager; + +class MsgViewInterface : public XQServiceProvider + { + Q_OBJECT + +public: + /** + * Constructor + */ + MsgViewInterface(MsgServiceViewManager* viewManager); + + /** + * Destructor + */ + ~MsgViewInterface(); + +public slots: + /** + * Opens the appropriate viewer for a given message id. + * @param msgId message Id + */ + void view(int msgId); + +private: + /** + * Pointer to view manager. + * Not owned. + */ + MsgServiceViewManager* mViewManager; + }; + +#endif /* __MSG_VIEW_INTERFACE_H__ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/msgserviceapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/msgserviceapp.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,69 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# Initial Contributors: +# Nokia Corporation - initial contribution. +# Contributors: +# Description: + +TEMPLATE = app +TARGET = msgserviceapp + +CONFIG += hb service + +DEPENDPATH += . inc src +SERVICE.FILE = service_conf.xml +SERVICE.OPTIONS = embeddable +SERVICE.OPTIONS += hidden + +INCLUDEPATH += inc +INCLUDEPATH += ../../../inc +INCLUDEPATH += ../../msgutils/s60qconversions/inc +INCLUDEPATH += ../../smartmessaging/ringbc/inc +INCLUDEPATH += ../../msgutils/unidatamodelloader/inc +INCLUDEPATH += ../../msgui/inc +INCLUDEPATH += ../../msgui/unifiedviewer/inc +INCLUDEPATH += ../../msgui/unifiededitor/inc +INCLUDEPATH += ../../msgsettings/settingsview/inc + +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + +# Input +HEADERS += inc/msgviewinterface.h \ + inc/msgservicewindow.h \ + inc/msgstorehandler.h \ + inc/msgsendinterface.h \ + inc/msgshareuiinterface.h \ + inc/msgserviceviewmanager.h + +SOURCES += src/main.cpp \ + src/msgviewinterface.cpp \ + src/msgservicewindow.cpp \ + src/msgstorehandler.cpp \ + src/msgsendinterface.cpp \ + src/msgshareuiinterface.cpp \ + src/msgserviceviewmanager.cpp + +# Capability +TARGET.CAPABILITY = ALL -TCB +TARGET.UID3 = 0x2002E6DA + +RESOURCES += msgserviceapp.qrc + +LIBS += -lxqservice \ + -lxqserviceutil \ + -ls60qconversions \ + -lconvergedmessageutils \ + -lmsgs \ + -lringbc \ + -lunidatamodelloader \ + -lunifiedviewer \ + -lunifiededitor \ + -lsettingsview + + +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + ".\rom\msgserviceapp.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msgserviceapp.iby)" diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/msgserviceapp.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/msgserviceapp.qrc Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,5 @@ + + + resources/messaging_en_GB + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/resources/messaging_en_GB Binary file messagingapp/msgservices/msgserviceapp/resources/messaging_en_GB has changed diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/rom/msgserviceapp.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/rom/msgserviceapp.iby Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,25 @@ +/* + * 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 __MSG_SERVICEAPP_IBY__ +#define __MSG_SERVICEAPP_IBY__ + +file=ABI_DIR\UREL\msgserviceapp.exe SHARED_LIB_DIR\msgserviceapp.exe +data=DATAZ_\resource\apps\msgserviceapp.rsc resource\apps\msgserviceapp.rsc +data=DATAZ_\private\10003a3f\import\apps\msgserviceapp_reg.rsc private\10003a3f\import\apps\msgserviceapp_reg.rsc + +#endif diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/service_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/service_conf.xml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,24 @@ + + + messaging + No path + Messaging services + + com.nokia.symbian.IFileShare + 1.0 + Share UI send interface + messaging + txt_messaging_list_attach_to_new_message + qtg_large_message + + + com.nokia.symbian.IMessageSend + 1.0 + Message send Interface + + + com.nokia.symbian.IMessageView + 1.0 + Message view Interface + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/main.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Messaging service application startup main(). +* +*/ + +#include +#include +#include +#include +#include +#include + +#include "msgservicewindow.h" +#include "debugtraces.h" + +//Localised constants +#define LOC_TITLE hbTrId("txt_messaging_title_messaging") + +const QString debugFileName("c:/msgservice_app.txt"); + +#ifdef _DEBUG_TRACES_ +void debugInit(QtMsgType type, const char *msg) +{ + + QFile ofile(debugFileName); + if (!ofile.open(QIODevice::Append | QIODevice::Text)) + { + qFatal("error opening results file"); + return; + } + QDateTime dt = QDateTime::currentDateTime(); + + QTextStream out(&ofile); + switch (type) + { + case QtDebugMsg: + out << " DEBUG:"; + out << msg; + break; + case QtWarningMsg: + out << " WARN:"; + out << msg; + break; + case QtCriticalMsg: + out << "\n "; + out << dt.toString("dd/MM/yyyy hh:mm:ss.zzz:ap"); + out << " CRITICAL:"; + out << msg; + break; + case QtFatalMsg: + out << " FATAL:"; + out << msg; + abort(); + break; + default: + out << " No Log Selection Type:"; + out << msg; + break; + + } +} +#endif + +int main(int argc, char **argv) +{ + HbApplication app( argc, argv ); + + //TODO: Uncomment the lines when actual + //translation files are available in sdk and remove loading locally. + QString locale = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + QTranslator translator; + //QTranslator translator_comm; + //translator.load(path + QString("messaging_") + locale); + //translator_comm.load(path + QString("common_") + locale); + translator.load( "messaging_en_GB", ":/translations" ); + app.installTranslator(&translator); + //app.installTranslator(&translator_comm); + + app.setApplicationName(LOC_TITLE); + + QPointer window = new MsgServiceWindow(); + window->show(); + + int rv = app.exec(); + delete window; + return rv; +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgsendinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgsendinterface.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,65 @@ +/* + * 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: Message send service interface used for interfacing between + * QT highway and other applications. + * + */ + +#include "msgsendinterface.h" +#include "msgserviceviewmanager.h" + +//---------------------------------------------------------------------------- +// MsgSendInterface::MsgSendInterface +// @see header +//---------------------------------------------------------------------------- +MsgSendInterface::MsgSendInterface(MsgServiceViewManager* viewManager) +:XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.IMessageSend"), + viewManager), +mViewManager(viewManager) + { + publishAll(); + } + +//---------------------------------------------------------------------------- +// MsgSendInterface::~MsgSendInterface +// @see header +//---------------------------------------------------------------------------- +MsgSendInterface::~MsgSendInterface() + { + } + +//---------------------------------------------------------------------------- +// MsgSendInterface::send +// @see header +//---------------------------------------------------------------------------- +void MsgSendInterface::send(const QString phoneNumber, + const qint32 contactId, + const QString displayName) + { + mViewManager->send(phoneNumber,contactId,displayName); + } + +//---------------------------------------------------------------------------- +// MsgSendInterface::send +// @see header +//---------------------------------------------------------------------------- +void MsgSendInterface::send(const QString phoneNumber, + const QString alias, + const QString bodyText) + { + mViewManager->send(phoneNumber, alias, bodyText); + } + +//EOF + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,483 @@ +/* + * 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: Manages differnt messaging views. + * + */ + +#include "msgserviceviewmanager.h" + +#include +#include +#include +#include + +#include +#include + +#include "msgunieditorview.h" +#include "unifiedviewer.h" +#include "msgstorehandler.h" + +#include "msgsettingsview.h" +#include "convergedmessageid.h" +#include "ringbc.h" +#include "unidatamodelloader.h" +#include "unidatamodelplugininterface.h" + +// LOCALIZATION +#define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete") +#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") +#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") +#define LOC_DLG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") +#define LOC_BUTTON_SAVE hbTrId("txt_common_menu_save") + +//---------------------------------------------------------------------------- +// MsgViewInterface::MsgViewInterface +// @see header +//---------------------------------------------------------------------------- +MsgServiceViewManager::MsgServiceViewManager(MsgStoreHandler* storeHandler, + HbMainWindow* mainWindow, QObject* parent) : + QObject(parent), mMainWindow(mainWindow), mUniEditor(NULL), + mUniViewer(NULL), mSettingsView(NULL), mBackAction(NULL), + mStoreHandler(storeHandler),mMessageId(-1) + { + //creating back action. + mBackAction = new HbAction(Hb::BackNaviAction, this); + connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); + + // create a temp view : which is required for lazy loading of other views + HbView* tempView = new HbView(); + mMainWindow->addView(tempView); + mMainWindow->setCurrentView(tempView); + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::~MsgServiceViewManager +// @see header +//---------------------------------------------------------------------------- +MsgServiceViewManager::~MsgServiceViewManager() + { + + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::onBackAction +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::onBackAction() + { + switch(mCurrentView) + { + case MsgBaseView::UNIEDITOR: + { + mUniEditor->saveContentToDrafts(); + HbApplication::quit(); + break; + } + case MsgBaseView::MSGSETTINGS: + { + //delete the settings instance + if (mSettingsView) + { + mMainWindow->removeView(mSettingsView); + delete mSettingsView; + mSettingsView = NULL; + } + if(mUniEditor) + { + mMainWindow->setCurrentView(mUniEditor); + mCurrentView = MsgBaseView::UNIEDITOR; + } + else + { + ConvergedMessage message; + QVariantList param; + QByteArray dataArray; + QDataStream messageStream(&dataArray, + QIODevice::WriteOnly | QIODevice::Append); + message.serialize(messageStream); + param << dataArray; + + // switch to editor + switchToUniEditor(param); + } + break; + } + case MsgBaseView::UNIVIEWER: + default: + { + HbApplication::quit(); + break; + } + + } + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::switchView +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::switchView(const QVariantList& data) + { + int viewId = data.at(0).toInt(); + switch (viewId) { + case MsgBaseView::UNIEDITOR: + { + // except first 2 parameters pass other parameters + QVariantList editorData; + for(int a = 2; a < data.length(); ++a) + { + editorData << data.at(a); + } + switchToUniEditor(editorData); + break; + } + + case MsgBaseView::MSGSETTINGS: + { + switchToMsgSettings(data); + break; + } + default: + { + HbApplication::quit(); + } + } + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::send +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::send(const QString phoneNumber, + const qint32 contactId, + const QString displayName) + { + ConvergedMessage message; + ConvergedMessageAddress address; + address.setAddress(phoneNumber); + address.setAlias(displayName); + message.addToRecipient(address); + + QVariantList param; + QByteArray dataArray; + QDataStream messageStream(&dataArray, + QIODevice::WriteOnly | QIODevice::Append); + message.serialize(messageStream); + param << dataArray; + + // switch to editor + switchToUniEditor(param); + + XQServiceUtil::toBackground(false); + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::send +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::send(const QString phoneNumber, + const QString alias, + const QString bodyText) + { + ConvergedMessage message; + ConvergedMessageAddress address; + address.setAddress(phoneNumber); + address.setAlias(alias); + message.addToRecipient(address); + message.setBodyText(bodyText); + + QVariantList param; + QByteArray dataArray; + QDataStream messageStream(&dataArray, + QIODevice::WriteOnly | QIODevice::Append); + message.serialize(messageStream); + param << dataArray; + + // switch to editor + switchToUniEditor(param); + + XQServiceUtil::toBackground(false); + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::send +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::send(QVariant data) + { + ConvergedMessage message; + ConvergedMessageAttachmentList attachmentList; + // handle multiple files from sendUI + // e.g. contacts can send multiple vcards + QStringList receivedFiles = data.toStringList(); + int recFileCount = receivedFiles.count(); + for (int i = 0; i < recFileCount; i++) { + ConvergedMessageAttachment *attachment = + new ConvergedMessageAttachment(receivedFiles.at(i)); + attachmentList.append(attachment); + } + message.addAttachments(attachmentList); + + QVariantList param; + QByteArray dataArray; + QDataStream messageStream(&dataArray, + QIODevice::WriteOnly | QIODevice::Append); + message.serialize(messageStream); + param << dataArray; + + // switch to editor + switchToUniEditor(param); + + XQServiceUtil::toBackground(false); + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::switchToUniEditor +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::switchToUniEditor(const QVariantList& editorData) + { + // construct + if (!mUniEditor) { + mUniEditor = new MsgUnifiedEditorView(); + mMainWindow->addView(mUniEditor); + mUniEditor->setNavigationAction(mBackAction); + connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, + SLOT(switchView(const QVariantList&))); + // construct completion : viewReady() signal was not called when + // editor is constructed first time. + // mUniEditor->doDelayedConstruction(); + } + + // populate + mUniEditor->populateContent(editorData); + + // set current view as editor + mMainWindow->setCurrentView(mUniEditor); + mCurrentView = MsgBaseView::UNIEDITOR; + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::switchToMsgSettings +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::switchToMsgSettings(const QVariantList& data) + { + MsgSettingsView::SettingsView view = MsgSettingsView::DefaultView; + + if (mCurrentView == MsgBaseView::UNIEDITOR) + { + view = (MsgSettingsView::SettingsView)data.at(2).toInt(); + } + + mCurrentView = MsgBaseView::MSGSETTINGS; + + if (!mSettingsView) { + mSettingsView = new MsgSettingsView(view); + mSettingsView->setNavigationAction(mBackAction); + mMainWindow->addView(mSettingsView); + } + mMainWindow->setCurrentView(mSettingsView); + } + +//---------------------------------------------------------------------------- +// MsgServiceViewManager::view +// @see header +//---------------------------------------------------------------------------- +void MsgServiceViewManager::view(int msgId) + { + int msgType; + int msgSubType; + + mMessageId = msgId; + // Mark as read and get message type + mStoreHandler->markAsReadAndGetType(msgId,msgType,msgSubType); + + switch (msgType) { + case ConvergedMessage::Sms: + case ConvergedMessage::Mms: + case ConvergedMessage::MmsNotification: + { + handleSmsMmsMsg(msgId); + break; + } + case ConvergedMessage::BioMsg: + { + if (msgSubType == ConvergedMessage::RingingTone) { + handleRingtoneMsg(msgId); + } + else if (msgSubType == ConvergedMessage::Provisioning) { + handleProvisoningMsg(msgId); + } + break; + } + case ConvergedMessage::BT: + { + handleBTMessage(msgId); + break; + } + default: + { + // for un supported message show delete option + HbMessageBox::question(LOC_DELETE_MESSAGE, + this,SLOT(onDialogDeleteMsg(HbAction*)), + LOC_BUTTON_DELETE, + LOC_BUTTON_CANCEL); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// MsgServiceViewManager::handleSmsMmsMsg +// @see header +// ---------------------------------------------------------------------------- +void MsgServiceViewManager::handleSmsMmsMsg(int msgId) + { + if (!mUniViewer) { + mUniViewer = new UnifiedViewer(msgId); + mUniViewer->setNavigationAction(mBackAction); + mMainWindow->addView(mUniViewer); + connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, + SLOT(switchView(const QVariantList&))); + } + mUniViewer->populateContent(msgId, true, 1); + + mMainWindow->setCurrentView(mUniViewer); + + // set current view as viewer + mCurrentView = MsgBaseView::UNIVIEWER; + } + +// ---------------------------------------------------------------------------- +// MsgServiceViewManager::handleRingtoneMsg +// @see header +// ---------------------------------------------------------------------------- +void MsgServiceViewManager::handleRingtoneMsg(int msgId) + { + mMessageId = msgId; + HbMessageBox::question(LOC_DLG_SAVE_RINGTONE, this, + SLOT(onDialogSaveTone(HbAction*)), LOC_BUTTON_SAVE, LOC_BUTTON_CANCEL); + } + +// ---------------------------------------------------------------------------- +// MsgServiceViewManager::handleProvisoningMsg +// @see header +// ---------------------------------------------------------------------------- +void MsgServiceViewManager::handleProvisoningMsg(int msgId) + { + QString messageId; + messageId.setNum(msgId); + + XQApplicationManager* aiwMgr = new XQApplicationManager(); + + XQAiwRequest* request = aiwMgr->create("com.nokia.services.MDM", + "Provisioning", + "ProcessMessage(QString)", true); // embedded + + if (request) { + QList args; + args << QVariant(messageId); + request->setArguments(args); + + // Send the request + bool res = request->send(); + + // Cleanup + delete request; + } + + delete aiwMgr; + + // close the application once its handled + HbApplication::quit(); + } + +//----------------------------------------------------------------------------- +//MsgServiceViewManager::handleBTMessage() +//@see header +//----------------------------------------------------------------------------- +void MsgServiceViewManager::handleBTMessage(int msgId) + { + XQApplicationManager* aiwMgr = new XQApplicationManager(); + XQAiwRequest* request = + aiwMgr->create("com.nokia.services.btmsgdispservices", "displaymsg", + "displaymsg(int)", true); // embedded + + if (request) { + QList args; + args << QVariant(msgId); + request->setArguments(args); + + // Send the request + bool res = request->send(); + + // Cleanup + delete request; + } + + delete aiwMgr; + + // close the application once its handled + HbApplication::quit(); + } + +//----------------------------------------------------------------------------- +//MsgServiceViewManager::onDialogDeleteMsg() +//@see header +//----------------------------------------------------------------------------- +void MsgServiceViewManager::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + mStoreHandler->deleteMessage(mMessageId); + } + HbApplication::quit(); // exit after handling +} + +//----------------------------------------------------------------------------- +//MsgServiceViewManager::onDialogSaveTone() +//@see header +//----------------------------------------------------------------------------- + +void MsgServiceViewManager::onDialogSaveTone(HbAction* action) + { + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + + UniDataModelLoader* pluginLoader = new UniDataModelLoader(); + UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin( + ConvergedMessage::BioMsg); + pluginInterface->setMessageId(mMessageId); + UniMessageInfoList attachments = pluginInterface->attachmentList(); + + QString attachmentPath = attachments.at(0)->path(); + + RingBc* ringBc = new RingBc(); + ringBc->saveTone(attachmentPath); + + // clear attachement list : its allocated at data model + while (!attachments.isEmpty()) { + delete attachments.takeFirst(); + } + + delete ringBc; + delete pluginLoader; + } + + // close the application once its handled + HbApplication::quit(); +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgservicewindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgservicewindow.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,88 @@ +/* + * 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: Message services manages all messaging Qt highway services. + * + */ + +#include "msgservicewindow.h" + +#include "msgviewinterface.h" +#include "msgsendinterface.h" +#include "msgshareuiinterface.h" + +#include "msgstorehandler.h" +#include "msgserviceviewmanager.h" + +// LOCALIZATION +#define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete") +#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") +#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") + + +// ---------------------------------------------------------------------------- +// MsgServiceWindow::MsgServiceWindow +// @see header +// ---------------------------------------------------------------------------- +MsgServiceWindow::MsgServiceWindow():HbMainWindow(),mSendInterface(NULL), +mViewInterface(NULL), +mShareUiInterface(NULL), +mStoreHandler(NULL), +mViewManager(NULL) + { + // create stote handler + mStoreHandler = new MsgStoreHandler(); + + // create view manager + mViewManager = new MsgServiceViewManager(mStoreHandler,this); + + // create interfaces + mSendInterface = new MsgSendInterface(mViewManager); + mViewInterface = new MsgViewInterface(mViewManager); + mShareUiInterface = new MsgShareUiInterface(mViewManager); + } + +// ---------------------------------------------------------------------------- +// MsgServiceWindow::~MsgServiceWindow +// @see header +// ---------------------------------------------------------------------------- +MsgServiceWindow::~MsgServiceWindow() + { + if(mShareUiInterface) + { + delete mShareUiInterface; + } + if(mViewInterface) + { + delete mViewInterface; + } + if(mSendInterface) + { + delete mSendInterface; + } + if(mViewManager) + { + delete mViewManager; + } + + if(mStoreHandler) + { + delete mStoreHandler; + } + } + + + + + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgshareuiinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgshareuiinterface.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,49 @@ +/* + * 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: Message share UI service interface used for interfacing between + * QT highway and other applications. + * + */ + +#include "msgshareuiinterface.h" +#include "msgserviceviewmanager.h" + +//---------------------------------------------------------------------------- +// MsgViewService::MsgViewService +// @see header +//---------------------------------------------------------------------------- +MsgShareUiInterface::MsgShareUiInterface(MsgServiceViewManager* viewManager) +:XQServiceProvider( QLatin1String("messaging.com.nokia.symbian.IFileShare"), + viewManager), +mViewManager(viewManager) + { + publishAll(); + } + +//---------------------------------------------------------------------------- +// MsgShareUiInterface::~MsgShareUiInterface +// @see header +//---------------------------------------------------------------------------- +MsgShareUiInterface::~MsgShareUiInterface() + { + } + +//---------------------------------------------------------------------------- +// MsgShareUiInterface::send +// @see header +//---------------------------------------------------------------------------- +void MsgShareUiInterface::send(QVariant data) + { + mViewManager->send(data); + } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2008 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: Reads message information from message store. + * + */ + +#include +#include +#include + +#include "msgstorehandler.h" +#include "MsgBioUids.h" +#include "convergedmessage.h" + +//---------------------------------------------------------------------------- +// MsgStoreHandler::MsgStoreHandler +// @see header +//---------------------------------------------------------------------------- +MsgStoreHandler::MsgStoreHandler(): +iMsvSession(NULL) + { + TRAP_IGNORE(InitL()); + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::~MsgStoreHandler +// @see header +//---------------------------------------------------------------------------- +MsgStoreHandler::~MsgStoreHandler() + { + if(iMsvSession) + { + delete iMsvSession; + iMsvSession = NULL; + } + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::InitL +// @see header +//---------------------------------------------------------------------------- +void MsgStoreHandler::InitL( ) + { + iMsvSession = CMsvSession::OpenSyncL(*this); + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::markAsReadAndGetType +// @see header +//---------------------------------------------------------------------------- +void MsgStoreHandler::markAsReadAndGetType(int msgId, + int& msgType, + int& msgSubType) + { + msgType = ConvergedMessage::None; + + CMsvEntry* cEntry = NULL; + TRAPD(err, cEntry = iMsvSession->GetEntryL(msgId)); + if ( err == KErrNone) + { + TMsvEntry entry = cEntry->Entry(); + if ( entry.Unread() ) + { + // Mark the entry as read + entry.SetUnread( EFalse ); + cEntry->ChangeL( entry ); + } + // extract message type + extractMsgType(entry,msgType,msgSubType); + } + + delete cEntry; + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::HandleSessionEventL +// @see header +//---------------------------------------------------------------------------- +void MsgStoreHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, + TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) + { + // Nothing to do + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::extractMsgType +// @see header +//---------------------------------------------------------------------------- +void MsgStoreHandler::extractMsgType(const TMsvEntry& entry, + int& msgType, + int& msgSubType) + { + msgType = ConvergedMessage::None; + msgSubType = ConvergedMessage::None; + + switch(entry.iMtm.iUid) + { + case KSenduiMtmSmsUidValue: + msgType = ConvergedMessage::Sms; + break; + case KSenduiMtmBtUidValue: + msgType = ConvergedMessage::BT; + break; + case KSenduiMtmMmsUidValue: + msgType = ConvergedMessage::Mms; + break; + case KSenduiMMSNotificationUidValue: + msgType = ConvergedMessage::MmsNotification; + break; + case KSenduiMtmBioUidValue: + { + msgType = ConvergedMessage::BioMsg; + + // based on the biotype uid set message type + if(entry.iBioType == KMsgBioUidRingingTone.iUid) + { + msgSubType = ConvergedMessage::RingingTone; + } + else if(entry.iBioType == KMsgBioProvisioningMessage.iUid) + { + msgSubType = ConvergedMessage::Provisioning; + } + else if (entry.iBioType == KMsgBioUidVCard.iUid) + { + msgSubType = ConvergedMessage::VCard; + } + else if (entry.iBioType == KMsgBioUidVCalendar.iUid) + { + msgSubType = ConvergedMessage::VCal; + } + } + break; + default: + msgType = ConvergedMessage::None; + break; + } + } + +//---------------------------------------------------------------------------- +// MsgStoreHandler::deleteMessage +// @see header +//---------------------------------------------------------------------------- +void MsgStoreHandler::deleteMessage(int msgId) + { + iMsvSession->RemoveEntry(msgId); + } +// End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgserviceapp/src/msgviewinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgserviceapp/src/msgviewinterface.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,50 @@ +/* + * 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: Message view service interface used for interfacing between + * QT highway and other applications. + * + */ + +#include "msgservicewindow.h" +#include "msgviewinterface.h" +#include "msgserviceviewmanager.h" + +//---------------------------------------------------------------------------- +// MsgViewInterface::MsgViewInterface +// @see header +//---------------------------------------------------------------------------- +MsgViewInterface::MsgViewInterface(MsgServiceViewManager* viewManager) +:XQServiceProvider( QLatin1String("messaging.com.nokia.symbian.IMessageView"), + viewManager), + mViewManager(viewManager) + { + publishAll(); + } + +//---------------------------------------------------------------------------- +// MsgViewInterface::~MsgViewInterface +// @see header +//---------------------------------------------------------------------------- +MsgViewInterface::~MsgViewInterface() + { + } + +//---------------------------------------------------------------------------- +// MsgViewInterface::view +// @see header +//---------------------------------------------------------------------------- +void MsgViewInterface::view(int msgId) + { + mViewManager->view(msgId); + } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgservices/msgservices.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgservices/msgservices.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +# Platforms +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +CONFIG += ordered +SUBDIRS += msgserviceapp/msgserviceapp.pro + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/bwins/settingsviewu.def --- a/messagingapp/msgsettings/bwins/settingsviewu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/bwins/settingsviewu.def Fri May 14 15:49:35 2010 +0300 @@ -4,13 +4,13 @@ ??_EMsgSettingsView@@UAE@I@Z @ 3 NONAME ; MsgSettingsView::~MsgSettingsView(unsigned int) ?trUtf8@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString MsgSettingsView::trUtf8(char const *, char const *, int) ?staticMetaObject@MsgSettingsView@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const MsgSettingsView::staticMetaObject - ??0MsgSettingsView@@QAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; MsgSettingsView::MsgSettingsView(class QGraphicsItem *) - ?tr@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString MsgSettingsView::tr(char const *, char const *) - ??1MsgSettingsView@@UAE@XZ @ 8 NONAME ; MsgSettingsView::~MsgSettingsView(void) - ?metaObject@MsgSettingsView@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * MsgSettingsView::metaObject(void) const - ?getStaticMetaObject@MsgSettingsView@@SAABUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const & MsgSettingsView::getStaticMetaObject(void) - ?tr@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString MsgSettingsView::tr(char const *, char const *, int) - ?qt_metacast@MsgSettingsView@@UAEPAXPBD@Z @ 12 NONAME ; void * MsgSettingsView::qt_metacast(char const *) + ?tr@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString MsgSettingsView::tr(char const *, char const *) + ?metaObject@MsgSettingsView@@UBEPBUQMetaObject@@XZ @ 7 NONAME ; struct QMetaObject const * MsgSettingsView::metaObject(void) const + ?getStaticMetaObject@MsgSettingsView@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & MsgSettingsView::getStaticMetaObject(void) + ?qt_metacast@MsgSettingsView@@UAEPAXPBD@Z @ 9 NONAME ; void * MsgSettingsView::qt_metacast(char const *) + ??0MsgSettingsView@@QAE@W4SettingsView@0@PAVQGraphicsItem@@@Z @ 10 NONAME ; MsgSettingsView::MsgSettingsView(enum MsgSettingsView::SettingsView, class QGraphicsItem *) + ??1MsgSettingsView@@UAE@XZ @ 11 NONAME ; MsgSettingsView::~MsgSettingsView(void) + ?tr@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString MsgSettingsView::tr(char const *, char const *, int) ?onSmsCenterEditViewClosed@MsgSettingsView@@QAEXXZ @ 13 NONAME ; void MsgSettingsView::onSmsCenterEditViewClosed(void) ?onNewSMSCCenterClicked@MsgSettingsView@@QAEXH@Z @ 14 NONAME ; void MsgSettingsView::onNewSMSCCenterClicked(int) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/eabi/settingsviewu.def --- a/messagingapp/msgsettings/eabi/settingsviewu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/eabi/settingsviewu.def Fri May 14 15:49:35 2010 +0300 @@ -5,8 +5,8 @@ _ZN15MsgSettingsView19getStaticMetaObjectEv @ 4 NONAME _ZN15MsgSettingsView22onNewSMSCCenterClickedEi @ 5 NONAME _ZN15MsgSettingsView25onSmsCenterEditViewClosedEv @ 6 NONAME - _ZN15MsgSettingsViewC1EP13QGraphicsItem @ 7 NONAME - _ZN15MsgSettingsViewC2EP13QGraphicsItem @ 8 NONAME + _ZN15MsgSettingsViewC1ENS_12SettingsViewEP13QGraphicsItem @ 7 NONAME + _ZN15MsgSettingsViewC2ENS_12SettingsViewEP13QGraphicsItem @ 8 NONAME _ZN15MsgSettingsViewD0Ev @ 9 NONAME _ZN15MsgSettingsViewD1Ev @ 10 NONAME _ZN15MsgSettingsViewD2Ev @ 11 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/inc/msgsettingsform.h --- a/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h Fri May 14 15:49:35 2010 +0300 @@ -20,17 +20,18 @@ #include #include "msgsettingengine.h" +#include "msgsettingsview.h" class HbDataFormModelItem; class HbDataFormModel; -class QStandardItemModel; -class QStandardItemModel; class MsgSettingsForm : public HbDataForm { Q_OBJECT public: - explicit MsgSettingsForm(QGraphicsItem *parent = 0); + explicit MsgSettingsForm( + MsgSettingsView::SettingsView settingsView = MsgSettingsView::DefaultView, + QGraphicsItem *parent = 0); ~MsgSettingsForm(); void refreshViewForm(); void expandSMSSettings(); @@ -39,7 +40,7 @@ void newSMSCCenterClicked(int); private: - void initSettingModel(); + void initSettingModel(MsgSettingsView::SettingsView settingsView); void addMMSGroupItem(HbDataFormModelItem* parent); void addSmsMCGroupItem(HbDataFormModelItem* parent); void updateSmsMCGroupItem(HbDataFormModelItem* parent); @@ -76,7 +77,6 @@ //msg engine reference MsgSettingEngine* mSettingEngine; - QStandardItemModel* mSmsServiceCenterModel; HbDataFormModelItem *smsMessageCenter; }; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/inc/msgsettingsview.h --- a/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h Fri May 14 15:49:35 2010 +0300 @@ -35,7 +35,18 @@ { Q_OBJECT public: - MsgSettingsView(QGraphicsItem *parent = 0); + enum SettingsView + { + DefaultView = 0, + SMSView, + MMSView + }; + +public: + MsgSettingsView( + SettingsView settingsView = MsgSettingsView::DefaultView, + QGraphicsItem *parent = 0); + ~MsgSettingsView(); public slots: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h --- a/messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h Fri May 14 15:49:35 2010 +0300 @@ -23,6 +23,7 @@ class HbLineEdit; class MsgSettingEngine; class HbDataFormModelItem; +class HbAction; class MsgSMSCenterSettingsForm : public HbDataForm { @@ -46,6 +47,12 @@ private slots: void onPressedCustomButton(); + + /** + * This slot is called delete message centre dialog launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsgCentre(HbAction* action); private: QString mCenterName; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/src/msgsettingsdataformcustomitem.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsettingsdataformcustomitem.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/src/msgsettingsdataformcustomitem.cpp Fri May 14 15:49:35 2010 +0300 @@ -49,10 +49,7 @@ case HbDataFormModelItem::CustomItemBase + 1: { //custom button - QString - str = - modelIndex().data(HbDataFormModelItem::KeyRole).toString(); - HbPushButton *button = new HbPushButton(str); + HbPushButton *button = new HbPushButton(); return button; } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp Fri May 14 15:49:35 2010 +0300 @@ -22,12 +22,10 @@ #include #include #include -#include #include "debugtraces.h" //Localized constants -#define LOC_MESSAGE_SETTINGS_HEADING hbTrId("txt_messaging_title_messaging_settings") #define LOC_RECEIVING_SERVICE_MESSAGES hbTrId("txt_messaging_setlabel_receiving_service_messages") #define LOC_ON hbTrId("txt_messaging_setlabel_val_on") #define LOC_OFF hbTrId("txt_messaging_setlabel_val_off") @@ -51,11 +49,11 @@ #define LOC_MMS_YES hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_yes") #define LOC_MMS_NO hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_no") -MsgSettingsForm::MsgSettingsForm(QGraphicsItem *parent) : +MsgSettingsForm::MsgSettingsForm( + MsgSettingsView::SettingsView settingsView, + QGraphicsItem *parent) : HbDataForm(parent) { - this->setHeading(LOC_MESSAGE_SETTINGS_HEADING); - mSettingEngine = new MsgSettingEngine(); //custom prototype @@ -69,7 +67,7 @@ mSmsMCSettingsGroup << LOC_SMS_CENTRE_IN_USE << LOC_ADD_NEW; //initialize the form model - initSettingModel(); + initSettingModel(settingsView); } MsgSettingsForm::~MsgSettingsForm() @@ -77,7 +75,8 @@ delete mSettingEngine; } -void MsgSettingsForm::initSettingModel() +void MsgSettingsForm::initSettingModel( + MsgSettingsView::SettingsView settingsView) { settingsModel = new HbDataFormModel(0); @@ -154,6 +153,19 @@ addSmsMCGroupItem(mSmsMCGroup); this->setModel(settingsModel); + + if (settingsView == MsgSettingsView::MMSView) + { + //set MMS Settings as expanded + QModelIndex index_mms = settingsModel->indexFromItem(mmsGroup); + //TODO: dataform issue on expanding one group item + //this->setExpanded(index_mms, true); + } + else if(settingsView == MsgSettingsView::SMSView) + { + //expandSMSSettings(); + } + } void MsgSettingsForm::refreshViewForm() @@ -168,24 +180,13 @@ mSmsServiceList.clear(); mSettingEngine->allSMSMessageCenter(mSmsServiceList, defaultServiceCenter); - mSmsServiceCenterModel->clear(); - - //recreate all the model items - int itemCount = mSmsServiceList.count(); - for (int i = 0; i < itemCount; ++i) + //set the content widget data again + smsMessageCenter->setContentWidgetData("items", mSmsServiceList); + if(defaultServiceCenter > 0) { - QStandardItem *item = new QStandardItem; - item->setData(mSmsServiceList.at(i), Qt::DisplayRole); - mSmsServiceCenterModel->appendRow(item); - } - //set the content widget data again - if(itemCount > 0) - { - smsMessageCenter->setContentWidgetData("items", mSmsServiceList); - } - smsMessageCenter->setContentWidgetData("currentIndex", defaultServiceCenter); + } //2. refresh all the custom buttons again int childCount = parent->childCount(); @@ -303,20 +304,10 @@ LOC_MMS_AP_IN_USE, 0); - QStandardItemModel* comboModel = new QStandardItemModel(); - QStringList mmsList; int defaultAccessPointIndex = -1; mSettingEngine->allMMsAcessPoints(mmsList, defaultAccessPointIndex); - int accessPoints = mmsList.count(); - for (int a = 0; a < accessPoints; ++a) - { - QStandardItem* item = new QStandardItem(); - item->setData(mmsList[a], Qt::DisplayRole); - comboModel->appendRow(item); - } - accessPoint->setModel(comboModel); accessPoint->setContentWidgetData("items", mmsList); if (defaultAccessPointIndex >= 0) { @@ -345,20 +336,9 @@ int defaultServiceCenter = -1; mSmsServiceList.clear(); + mSettingEngine->allSMSMessageCenter(mSmsServiceList, defaultServiceCenter); - mSmsServiceCenterModel = new QStandardItemModel(this); - - int itemCount = mSmsServiceList.count(); - for (int i = 0; i < itemCount; ++i) - { - QStandardItem *item = new QStandardItem; - item->setData(mSmsServiceList.at(i), Qt::DisplayRole); - mSmsServiceCenterModel->appendRow(item); - } - - smsMessageCenter->setModel(mSmsServiceCenterModel); smsMessageCenter->setContentWidgetData("items", mSmsServiceList); - if (defaultServiceCenter >= 0) { smsMessageCenter->setContentWidgetData("currentIndex", diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp Fri May 14 15:49:35 2010 +0300 @@ -15,24 +15,43 @@ * */ #include +#include +#include #include "msgsettingsview.h" #include "msgsettingsform.h" #include "msgsmscenterview.h" #include "debugtraces.h" -MsgSettingsView::MsgSettingsView(QGraphicsItem *parent) : - MsgBaseView(parent), mSMSCenterView(0) +//LOCALAIZED CONSTANTS +#define LOC_MESSAGE_SETTINGS_HEADING hbTrId("txt_messaging_title_messaging_settings") + +MsgSettingsView::MsgSettingsView(SettingsView settingsView, + QGraphicsItem *parent) : + MsgBaseView(parent), mSMSCenterView(0), mSettingsForm(0) { - mSettingsForm = new MsgSettingsForm(); + mMainWindow = this->mainWindow(); - setWidget(mSettingsForm); - mMainWindow = this->mainWindow(); + // Create parent layout. + QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mainLayout->setContentsMargins(0, 0, 0, 0); + mainLayout->setSpacing(0); + + // Create view heading. + HbGroupBox *viewHeading = new HbGroupBox(); + viewHeading->setHeading(LOC_MESSAGE_SETTINGS_HEADING); + + mSettingsForm = new MsgSettingsForm(settingsView); connect(mSettingsForm, SIGNAL(newSMSCCenterClicked(int)), this, SLOT(onNewSMSCCenterClicked(int))); + + mainLayout->addItem(viewHeading); + mainLayout->addItem(mSettingsForm); + + this->setLayout(mainLayout); } MsgSettingsView::~MsgSettingsView() @@ -50,13 +69,13 @@ } mSMSCenterView = new MsgSMSCenterView(index); - + connect(mSMSCenterView, SIGNAL(smsCenterEditViewClosed()), this, SLOT(onSmsCenterEditViewClosed())); - - mMainWindow->addView(mSMSCenterView); + + mMainWindow->addView(mSMSCenterView); mMainWindow->setCurrentView(mSMSCenterView); } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp Fri May 14 15:49:35 2010 +0300 @@ -26,11 +26,10 @@ #include #include #include +#include #include "debugtraces.h" //Localized constants -#define LOC_NEW_SMS_CENTRE hbTrId("txt_messaging_title_new_sms_message_centre") -#define LOC_EDIT_SMS_CENTRE hbTrId("txt_messaging_title_edit_sms_message_centre") #define LOC_SMS_CENTRE_NAME hbTrId("txt_messaging_setlabel_message_centre_name") #define LOC_SMS_CENTRE_NUMBER hbTrId("txt_messaging_setlabel_message_centre_number") #define LOC_SMS_CENTRE_DELETE hbTrId("txt_messaging_button_delete_message_centre") @@ -43,14 +42,9 @@ HbDataForm(parent), mEdit1(0), mEdit2(0), mView(view) { QString heading; - if (mView == -1) + if (mView > -1) { - heading = LOC_NEW_SMS_CENTRE; - } - else - { - heading = LOC_EDIT_SMS_CENTRE; - //custom prototype + //add the custom prototype only for edit items MsgSettingsDataFormCustomItem* customPrototype = new MsgSettingsDataFormCustomItem(this); @@ -59,8 +53,6 @@ this->setItemPrototypes(protos); } - this->setHeading(heading); - bool b = connect(this, SIGNAL(itemShown(const QModelIndex&)), this, @@ -182,37 +174,34 @@ if (itemData && itemData == messageCenterName && !mEdit1) { QDEBUG_WRITE("messageCenterName updated.."); - mEdit1 - = static_cast ( - this->dataFormViewItem( - topLeft)->dataItemContentWidget()); + HbDataFormViewItem* item1 = + static_cast(this->itemByIndex(topLeft)); + mEdit1 = static_cast(item1->dataItemContentWidget()); } else if (itemData && itemData == messageCenterNumber && !mEdit2) { QDEBUG_WRITE("messageCenterNumber updated.."); - mEdit2 - = static_cast ( - this->dataFormViewItem( - topLeft)->dataItemContentWidget()); - - HbEditorInterface editorInterface(mEdit2); - editorInterface.setUpAsPhoneNumberEditor(); + HbDataFormViewItem* item1 = + static_cast(this->itemByIndex(topLeft)); + mEdit2 = static_cast(item1->dataItemContentWidget()); + mEdit2->setInputMethodHints(Qt::ImhPreferNumbers); } } void MsgSMSCenterSettingsForm::onPressedCustomButton() { - bool result = HbMessageBox::question("Delete message centre ?", - LOC_BUTTON_DELETE, - LOC_BUTTON_CANCEL); + HbMessageBox::question(LOC_SMS_CENTRE_DELETE, this, SLOT(onDialogDeleteMsgCentre(HbAction*)), LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); +} - if (result) - { +void MsgSMSCenterSettingsForm::onDialogDeleteMsgCentre(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { //delete from m/w -- mView is the index to delete - mSettingEngine->deleteSmsMessageCenter(mView); - emit deleteMessageCentreAndClose(); - } + mSettingEngine->deleteSmsMessageCenter(mView); + emit deleteMessageCentreAndClose(); + } } //eof diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp Fri May 14 15:49:35 2010 +0300 @@ -15,27 +15,50 @@ * */ #include +#include +#include #include "msgsmscenterview.h" #include "msgsmscentersettingsform.h" #include "debugtraces.h" +#define LOC_NEW_SMS_CENTRE hbTrId("txt_messaging_title_new_sms_message_centre") +#define LOC_EDIT_SMS_CENTRE hbTrId("txt_messaging_title_edit_sms_message_centre") + MsgSMSCenterView::MsgSMSCenterView(int view, QGraphicsItem *parent) : MsgBaseView(parent) { + // Create parent layout. + QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mainLayout->setContentsMargins(0, 0, 0, 0); + mainLayout->setSpacing(0); + + // Create view heading. + HbGroupBox *viewHeading = new HbGroupBox(); + if (view == -1) + { + viewHeading->setHeading(LOC_NEW_SMS_CENTRE); + } + else + { + viewHeading->setHeading(LOC_EDIT_SMS_CENTRE); + } + mSMSCenterSettingsForm = new MsgSMSCenterSettingsForm(view); - setWidget(mSMSCenterSettingsForm); - - HbAction* backAction = new HbAction(Hb::BackAction, this); + HbAction* backAction = new HbAction(Hb::BackNaviAction, this); setNavigationAction(backAction); connect(mSMSCenterSettingsForm, SIGNAL(deleteMessageCentreAndClose()), this, SLOT(onCloseMessageCenterView())); + + connect(backAction, SIGNAL(triggered()), this, SLOT(onBackAction())); - connect(backAction, SIGNAL(triggered()), this, SLOT(onBackAction())); + mainLayout->addItem(viewHeading); + mainLayout->addItem(mSMSCenterSettingsForm); + this->setLayout(mainLayout); } MsgSMSCenterView::~MsgSMSCenterView() diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/appengine.pro --- a/messagingapp/msgui/appengine/appengine.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/appengine.pro Fri May 14 15:49:35 2010 +0300 @@ -22,6 +22,7 @@ INCLUDEPATH += ../../../inc INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc INCLUDEPATH += ../../msgutils/s60qconversions/inc +INCLUDEPATH += ../../smartmessaging/ringbc/inc INCLUDEPATH += /ext/mw/qtextensions/qtmobileextensions/include INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE @@ -84,7 +85,9 @@ -lmmscli \ -lcommonengine \ -lmmsserversettings \ - -lFeatMgr + -lsqldb \ + -lestor \ + -lFeatMgr \ + -lringbc - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h --- a/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Fri May 14 15:49:35 2010 +0300 @@ -143,13 +143,13 @@ * Sets content to messageId * @param messageId, Message Id content */ - void setNotificationMessageId(int messageId); + void setNotificationMessageIdL(int messageId); /** * Seeker method for getting mms notification estimated msg size * @return Formatted string of msg size */ - QString NotificationMsgSize(); + QString NotificationMsgSizeL(); /** * Seeker method for getting mms notification class type @@ -273,7 +273,7 @@ */ CMmsNotificationClientMtm* iNotificationClient; - TBool iOfflineSupported; + TBool iOfflineSupported; }; #endif // CONVERSATION_MSG_STORE_HANDLER_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/inc/conversationsengine.h --- a/messagingapp/msgui/appengine/inc/conversationsengine.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/inc/conversationsengine.h Fri May 14 15:49:35 2010 +0300 @@ -21,6 +21,7 @@ // INCLUDES #include #include +#include #ifdef BUILD_DLL #define CONVERSATIONS_ENGINE_API_EXPORT Q_DECL_EXPORT @@ -202,6 +203,13 @@ void markAsReadAndGetType( qint32 messageId, int& msgType, int& msgSubType); + + /* + * Get SQL DB handle + * @param isOpen, set to true if open, check this before using the handle + */ + RSqlDatabase& getDBHandle(TBool& isOpen); + private: /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/inc/conversationsengineutility.h --- a/messagingapp/msgui/appengine/inc/conversationsengineutility.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/inc/conversationsengineutility.h Fri May 14 15:49:35 2010 +0300 @@ -52,13 +52,6 @@ */ static int messageSubType(TCsType value); - /** - * Get display-name of a contact from VCard. - * @param filePath, VCard file-path - * @return display-name - */ - static QString getVcardDisplayName(QString filePath); - }; #endif //CONVERSATIONS_ENGINE_UTILITY_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/inc/conversationsmodel.h --- a/messagingapp/msgui/appengine/inc/conversationsmodel.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/inc/conversationsmodel.h Fri May 14 15:49:35 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include // FORWARD DECLARATIONS class CCsConversationEntry; @@ -75,6 +76,12 @@ * @param msgId, Message Id */ void deleteRow(int msgId); + + /* + * Get SQL DB handle + * @param isOpen, set to true if open, check this before using the handle + */ + RSqlDatabase& getDBHandle(TBool& isOpen); private: @@ -141,6 +148,16 @@ * Not Own */ UniDataModelPluginInterface* iBioMsgPlugin; + + /* + * SQL DB handle + */ + RSqlDatabase iSqlDb; + + /* + * DB open. + */ + TBool iSqlDbOpen; }; #endif // CONVERSATIONS_MODEL_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp --- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -407,8 +407,11 @@ mDraftsModel = draftsModel; iState = EReadDrafts; TCallBack callback = TCallBack(ProcessDraftMessages, (TAny*) this); - iIdle = CIdle::NewL(CActive::EPriorityStandard); - iIdle->Start(callback); + TRAPD(err, iIdle = CIdle::NewL(CActive::EPriorityStandard)); + if(err == KErrNone) + { + iIdle->Start(callback); + } } // ----------------------------------------------------------------------------- @@ -648,10 +651,10 @@ } //--------------------------------------------------------------- -// ConversationMsgStoreHandler::setNotificationMessageId +// ConversationMsgStoreHandler::setNotificationMessageIdL // @see header //--------------------------------------------------------------- -void ConversationMsgStoreHandler::setNotificationMessageId(int messageId) +void ConversationMsgStoreHandler::setNotificationMessageIdL(int messageId) { // get MMS Notification client mtm & set the content to current entry if(iNotificationClient) @@ -668,10 +671,10 @@ } //--------------------------------------------------------------- -// ConversationMsgStoreHandler::NotificationMsgSize +// ConversationMsgStoreHandler::NotificationMsgSizeL // @see header //--------------------------------------------------------------- -QString ConversationMsgStoreHandler::NotificationMsgSize() +QString ConversationMsgStoreHandler::NotificationMsgSizeL() { // Size of message. TInt size = iNotificationClient->MessageTransferSize( ); @@ -841,7 +844,7 @@ iNotificationClient->SwitchCurrentEntryL(aId); */ // set context to current entry - setNotificationMessageId(aId); + setNotificationMessageIdL(aId); TTime currentTime; currentTime.HomeTime( ); @@ -925,7 +928,7 @@ { // Mark the entry as read entry.SetUnread( EFalse ); - cEntry->ChangeL( entry ); + TRAP_IGNORE(cEntry->ChangeL( entry )); } // extract message type extractMsgType(entry,msgType,msgSubType); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationsengine.cpp --- a/messagingapp/msgui/appengine/src/conversationsengine.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationsengine.cpp Fri May 14 15:49:35 2010 +0300 @@ -335,7 +335,14 @@ msgSubType); } - +//--------------------------------------------------------------- +// ConversationsEngine::getDBHandle() +// @see header +//--------------------------------------------------------------- +RSqlDatabase& ConversationsEngine::getDBHandle(TBool& isOpen) + { + return mConversationsModel->getDBHandle(isOpen); + } //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationsengine_p.cpp --- a/messagingapp/msgui/appengine/src/conversationsengine_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationsengine_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -26,6 +26,7 @@ #include "conversationsmodel.h" #include "conversationchangehandler.h" #include "conversationlistchangehandler.h" +#include "debugtraces.h" //--------------------------------------------------------------- // ConversationsEnginePrivate::ConversationsEnginePrivate @@ -58,16 +59,17 @@ { if(mServer) { - mServer->RemoveConversationChangeEventL (mConvChangeHandler, - mClientConv); + TRAP_IGNORE(mServer->RemoveConversationChangeEventL( + mConvChangeHandler,mClientConv)); } delete mClientConv; mClientConv = NULL; } if(mServer) { - mServer->RemoveConversationListChangeEventL (mConvListChangeHandler); - mServer->RemoveResultsEventL ( this ); + TRAP_IGNORE(mServer->RemoveConversationListChangeEventL( + mConvListChangeHandler)); + TRAP_IGNORE(mServer->RemoveResultsEventL ( this )); mServer->Cancel(); delete mServer; mServer = NULL; @@ -113,6 +115,7 @@ { if(!mClientConv) { + QCRITICAL_WRITE("ConversationsEnginePrivate::getConversationsL start."); //Clear the model before issueing fetch mConversationsModel->clear(); //create a client conversation @@ -120,12 +123,15 @@ mClientConv->SetConversationEntryId(aConversationId); //set dummy entry CCsConversationEntry *entry = CCsConversationEntry::NewL(); - CleanupStack::PushL(entry); + CleanupStack::PushL(entry); mClientConv->SetConversationEntryL(entry); - CleanupStack::PopAndDestroy(entry); + CleanupStack::PopAndDestroy(entry); //Get the conversations for new conversationId - mServer->GetConversationsL( mClientConv ); - } + mServer->GetConversationsL(mClientConv); + + QCRITICAL_WRITE("ConversationsEnginePrivate::getConversationsL end."); + } + } //--------------------------------------------------------------- @@ -220,6 +226,8 @@ //--------------------------------------------------------------- void ConversationsEnginePrivate::clearConversationsL() { + QCRITICAL_WRITE("ConversationsEnginePrivate::clearConversationsL start."); + mConvChangeHandler->Cancel(); //Clear conversations model before populating with new data mConversationsModel->clear(); @@ -232,6 +240,8 @@ delete mClientConv; mClientConv = NULL; } + + QCRITICAL_WRITE("ConversationsEnginePrivate::clearConversationsL end."); } //--------------------------------------------------------------- @@ -267,10 +277,14 @@ RPointerArray& aConversationEntryList) { int error; - if(mClientConv) - { + if (mClientConv) + { + QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations start."); + TRAP(error,mConvChangeHandler->ConversationsL(aConversationEntryList)); - } + + QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations end."); + } } @@ -280,9 +294,9 @@ //--------------------------------------------------------------- void ConversationsEnginePrivate::fetchMoreConversations() { - if(mClientConv) - { - mConvChangeHandler->restartHandleConversations(); + if (mClientConv) + { + mConvChangeHandler->restartHandleConversations(); } } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationsengineutility.cpp --- a/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Fri May 14 15:49:35 2010 +0300 @@ -119,40 +119,4 @@ return messageSubType; } -//--------------------------------------------------------------- -// ConversationsEngineUtility::getVcardDisplayName -// @see header -//--------------------------------------------------------------- -QString ConversationsEngineUtility::getVcardDisplayName(QString filePath) -{ - QString displayName; - //open file for parsing - QFile file(filePath); - if (!file.open(QIODevice::ReadOnly)) { - return displayName; - } - // parse contents - QVersitReader reader; - reader.setDevice(&file); - if (reader.startReading()) { - if (reader.waitForFinished()) { - QList versitDocuments = reader.results(); - // Use the resulting document - if (versitDocuments.count() > 0) { - QVersitContactImporter importer; - QList contacts = importer.importContacts(versitDocuments); - // get display-name - if (contacts.count() > 0) { - QContactManager* contactManager = new QContactManager("symbian"); - displayName = contactManager->synthesizedDisplayLabel(contacts[0]); - delete contactManager; - } - } - } - } - file.close(); - - return displayName; -} - // End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationsmodel.cpp --- a/messagingapp/msgui/appengine/src/conversationsmodel.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationsmodel.cpp Fri May 14 15:49:35 2010 +0300 @@ -23,11 +23,21 @@ #include "conversationsengineutility.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" +#include "ringbc.h" +#include "msgcontacthandler.h" #include + +#include "debugtraces.h" + #include #include +#include +#include -// LOCAL CONSTANTS +//CONSTANTS +_LIT(KDbFileName, "c:[2002A542]conversations.db"); +// preview sql query +_LIT(KSelectConvMsgsStmt, "SELECT message_id, subject, body_text, preview_path, msg_property FROM conversation_messages WHERE message_id=:message_id "); //--------------------------------------------------------------- // ConversationsModel::ConversationsModel @@ -35,8 +45,13 @@ //--------------------------------------------------------------- ConversationsModel::ConversationsModel(ConversationMsgStoreHandler* msgStoreHandler, QObject* parent) : - QStandardItemModel(parent), mMsgStoreHandler(msgStoreHandler) + QStandardItemModel(parent), mMsgStoreHandler(msgStoreHandler), iSqlDbOpen(EFalse) { + //Open SQL DB + if (KErrNone == iSqlDb.Open(KDbFileName)) + { + iSqlDbOpen = ETrue; + } iDataModelPluginLoader = new UniDataModelLoader; iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::Mms); iBioMsgPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); @@ -48,6 +63,9 @@ //--------------------------------------------------------------- ConversationsModel::~ConversationsModel() { + //Close SQL-DB + iSqlDb.Close(); + if (iDataModelPluginLoader) { delete iDataModelPluginLoader; iDataModelPluginLoader = NULL; @@ -244,6 +262,8 @@ //--------------------------------------------------------------- void ConversationsModel::populateItem(QStandardItem& item, const CCsConversationEntry& entry) { + QCRITICAL_WRITE("ConversationsModel::populateItem start."); + int msgId = entry.EntryId(); // id item.setData(msgId, ConvergedMsgId); @@ -304,7 +324,9 @@ //message specific handling if (msgType == ConvergedMessage::Mms) { + QCRITICAL_WRITE("ConversationsModel::populateItem MMS start.") handleMMS(item, entry); + QCRITICAL_WRITE("ConversationsModel::populateItem MMS end.") } else if(msgType == ConvergedMessage::MmsNotification) { item.setData(subject, Subject); @@ -320,6 +342,8 @@ // sms bodytext item.setData(subject, BodyText); } + + QCRITICAL_WRITE("ConversationsModel::populateItem end."); } //--------------------------------------------------------------- @@ -328,46 +352,159 @@ //--------------------------------------------------------------- void ConversationsModel::handleMMS(QStandardItem& item, const CCsConversationEntry& entry) { - iMmsDataPlugin->setMessageId(entry.EntryId()); - if (iMmsDataPlugin->attachmentCount() > 0) { - item.setData(ConvergedMessage::Attachment, MessageProperty); - } + //msg_id + int msgId = entry.EntryId(); + + bool isEntryInDb = false; + TInt err = KErrNone; + + //check if db is open and query db + if (iSqlDbOpen) + { + RSqlStatement sqlSelectStmt; + err = sqlSelectStmt.Prepare(iSqlDb, KSelectConvMsgsStmt); + + // move to fallback option + if (KErrNone == err) + { + TInt msgIdIndex = sqlSelectStmt.ParameterIndex(_L(":message_id")); + TInt subjectIndex = sqlSelectStmt.ColumnIndex(_L("subject")); + TInt bodyIndex = sqlSelectStmt.ColumnIndex(_L("body_text")); + TInt previewPathIndex = sqlSelectStmt.ColumnIndex( + _L("preview_path")); + TInt msgpropertyIndex = sqlSelectStmt.ColumnIndex( + _L("msg_property")); + + err = sqlSelectStmt.BindInt(msgIdIndex, msgId); + + // populate item + if ((KErrNone == err) && (sqlSelectStmt.Next() == KSqlAtRow)) + { + RBuf subjectBuffer; + subjectBuffer.Create(sqlSelectStmt.ColumnSize(subjectIndex)); + sqlSelectStmt.ColumnText(subjectIndex, subjectBuffer); + + item.setData( + S60QConversions::s60DescToQString(subjectBuffer), + Subject); + subjectBuffer.Close(); + + RBuf bodyBuffer; + bodyBuffer.Create(sqlSelectStmt.ColumnSize(bodyIndex)); + sqlSelectStmt.ColumnText(bodyIndex, bodyBuffer); + + item.setData(S60QConversions::s60DescToQString(bodyBuffer), + BodyText); + bodyBuffer.Close(); + + RBuf previewPathBuffer; + previewPathBuffer.Create(sqlSelectStmt.ColumnSize( + previewPathIndex)); + sqlSelectStmt.ColumnText(previewPathIndex, previewPathBuffer); - int slideCount = iMmsDataPlugin->slideCount(); - bool isBodyTextSet = false; - QString textContent; - QStringList attachmentPaths; + //Rightnow set inside attachments + item.setData(S60QConversions::s60DescToQString( + previewPathBuffer), Attachments); + previewPathBuffer.Close(); + + int msgProperty = 0; + msgProperty = sqlSelectStmt.ColumnInt(msgpropertyIndex); + item.setData(msgProperty, MessageProperty); + + //set flag to disable fallback option + isEntryInDb = true; + } + } + sqlSelectStmt.Close(); + } + + //fallback option incase of db operation failure or enry not found in DB + //populate from data plugins + if (!isEntryInDb || err != KErrNone) + { + iMmsDataPlugin->setMessageId(entry.EntryId()); + int msgProperty = 0; - for (int i = 0; i < slideCount; ++i) { - UniMessageInfoList objectList = iMmsDataPlugin->slideContent(i); - for (int index = 0; index < objectList.count(); ++index) { - attachmentPaths.append(objectList[index]->path()); - if (!isBodyTextSet && objectList[index]->mimetype().contains("text")) { - QFile file(objectList[index]->path()); - if(file.open(QIODevice::ReadOnly)) + if (iMmsDataPlugin->attachmentCount() > 0) + { + msgProperty |= EPreviewAttachment; + } + + //subject + item.setData(iMmsDataPlugin->subject(), Subject); + + int slideCount = iMmsDataPlugin->slideCount(); + bool isBodyTextSet = false; + bool isAudioSet = false; + bool isImageSet = false; + bool isVideoSet = false; + QString textContent; + QString videoPath; + QString imagePath; + + for (int i = 0; i < slideCount; ++i) + { + UniMessageInfoList objectList = iMmsDataPlugin->slideContent(i); + for (int index = 0; index < objectList.count(); ++index) + { + if (!isBodyTextSet && objectList[index]->mimetype().contains( + "text")) { + QFile file(objectList[index]->path()); + file.open(QIODevice::ReadOnly); textContent = file.readAll(); item.setData(textContent, BodyText); isBodyTextSet = true; file.close(); } + if (!isImageSet && objectList[index]->mimetype().contains( + "image")) + { + isImageSet = true; + msgProperty |= EPreviewImage; + imagePath = objectList[index]->path(); + } + if (!isAudioSet && objectList[index]->mimetype().contains( + "audio")) + { + msgProperty |= EPreviewAudio; + isAudioSet = true; + } + if (!isVideoSet && objectList[index]->mimetype().contains( + "video")) + { + isVideoSet = true; + msgProperty |= EPreviewVideo; + videoPath = objectList[index]->path(); + } } + foreach(UniMessageInfo* slide,objectList) + { + delete slide; + } } - foreach(UniMessageInfo* slide,objectList) - { - delete slide; - } + //populate item with the attachment list + if (isVideoSet) + { + item.setData(videoPath, Attachments); + } + else if (isImageSet) + { + item.setData(imagePath, Attachments); + } + //populate msgProperty + item.setData(msgProperty, MessageProperty); } - //populate item with the attachment list - item.setData(attachmentPaths.join("|"), Attachments); - if (entry.IsAttributeSet(ECsAttributeHighPriority)) { + + // fill other attributes + if (entry.IsAttributeSet(ECsAttributeHighPriority)) + { item.setData(ConvergedMessage::High, MessagePriority); } - else if (entry.IsAttributeSet(ECsAttributeLowPriority)) { + else if (entry.IsAttributeSet(ECsAttributeLowPriority)) + { item.setData(ConvergedMessage::Low, MessagePriority); } - //subject - item.setData(iMmsDataPlugin->subject(), Subject); } //--------------------------------------------------------------- @@ -378,12 +515,18 @@ const CCsConversationEntry& entry) { // set context to current entry - mMsgStoreHandler->setNotificationMessageId(entry.EntryId()); + TRAPD(err, mMsgStoreHandler->setNotificationMessageIdL(entry.EntryId())); + if(err != KErrNone) + { + return; + } // fetch relevent info to show in CV // msg size - QString estimatedMsgSizeStr = - mMsgStoreHandler->NotificationMsgSize(); + QString estimatedMsgSizeStr = QString("%1").arg(0); + estimatedMsgSizeStr.append(" Kb"); + TRAP_IGNORE(estimatedMsgSizeStr = + mMsgStoreHandler->NotificationMsgSizeL()); // msg class type QString classInfoStr = mMsgStoreHandler->NotificationClass(); @@ -445,7 +588,8 @@ item.setData(ConvergedMessage::VCard, MessageSubType); //parse vcf file to get the details - QString displayName = ConversationsEngineUtility::getVcardDisplayName(description); + QString displayName = MsgContactHandler::getVCardDisplayName( + description); item.setData(displayName, BodyText); } else @@ -482,7 +626,9 @@ QString attachmentPath = attList[0]->path(); //get display-name and set as bodytext - QString displayName = ConversationsEngineUtility::getVcardDisplayName(attachmentPath); + QString displayName = + MsgContactHandler::getVCardDisplayName( + attachmentPath); item.setData(displayName, BodyText); // clear attachement list : its allocated at data model @@ -494,6 +640,20 @@ else if (ConvergedMessage::VCal == msgSubType) { //not supported } + else if (ConvergedMessage::RingingTone == msgSubType) { + if (iBioMsgPlugin->attachmentCount() > 0) { + UniMessageInfoList attList = iBioMsgPlugin->attachmentList(); + QString attachmentPath = attList[0]->path(); + + //get tone title, and set as bodytext + RingBc ringBc; + item.setData(ringBc.toneTitle(attachmentPath), BodyText); + while (!attList.isEmpty()) { + delete attList.takeFirst(); + } + } + + } else { // description HBufC* description = entry.Description(); @@ -505,4 +665,13 @@ } } +//--------------------------------------------------------------- +// ConversationsModel::getDBHandle() +// @see header +//--------------------------------------------------------------- +RSqlDatabase& ConversationsModel::getDBHandle(TBool& isOpen) +{ + isOpen = iSqlDbOpen; + return iSqlDb; +} //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/src/conversationssummarymodel.cpp --- a/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Fri May 14 15:49:35 2010 +0300 @@ -22,7 +22,8 @@ #include "convergedmessage.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" - +#include "ringbc.h" +#include "msgcontacthandler.h" #include #include #include @@ -301,7 +302,8 @@ item.setData(ConvergedMessage::VCard, MessageSubType); //parse vcf file to get the details - QString displayName = ConversationsEngineUtility::getVcardDisplayName(description); + QString displayName = MsgContactHandler::getVCardDisplayName( + description); item.setData(displayName, BodyText); } else @@ -341,7 +343,8 @@ QString attachmentPath = attList[0]->path(); //get display-name and set as bodytext - QString displayName = ConversationsEngineUtility::getVcardDisplayName(attachmentPath); + QString displayName = MsgContactHandler::getVCardDisplayName( + attachmentPath); item.setData(displayName, BodyText); // clear attachement list : its allocated at data model @@ -353,6 +356,19 @@ else if (ConvergedMessage::VCal == msgSubType) { //not supported } + else if (ConvergedMessage::RingingTone == msgSubType) { + if (bioMsgPlugin->attachmentCount() > 0) { + UniMessageInfoList attList = bioMsgPlugin->attachmentList(); + QString attachmentPath = attList[0]->path(); + + //get tone title, and set as bodytext + RingBc ringBc; + item.setData(ringBc.toneTitle(attachmentPath), BodyText); + while (!attList.isEmpty()) { + delete attList.takeFirst(); + } + } + } else { // description HBufC* description = entry.Description(); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/bwins/testconversationengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/bwins/testconversationengineu.def Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,93 @@ +EXPORTS + ?trUtf8@TConversationEngine@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString TConversationEngine::trUtf8(char const *, char const *, int) + ?tr@TConversationEngine@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString TConversationEngine::tr(char const *, char const *, int) + ?fetchMoreConversations@ConversationsEngine@@QAEXXZ @ 3 NONAME ; void ConversationsEngine::fetchMoreConversations(void) + ?NotifyNewConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 4 NONAME ; void TConversationEngine::NotifyNewConversationClientAndUpdateCLV(void) + ?FetchMoreConversations@TConversationEngine@@AAEXXZ @ 5 NONAME ; void TConversationEngine::FetchMoreConversations(void) + ?tr@TConversationEngine@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString TConversationEngine::tr(char const *, char const *) + ?FetchConversationsAndUpdateCV@TConversationEngine@@AAEXXZ @ 7 NONAME ; void TConversationEngine::FetchConversationsAndUpdateCV(void) + ?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 8 NONAME ; bool ConversationsEngine::deleteConversations(long long) + ?staticMetaObject@TConversationEngine@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const TConversationEngine::staticMetaObject + ?DeleteConversationL@CCSRequestHandler@@QAEXH@Z @ 10 NONAME ; void CCSRequestHandler::DeleteConversationL(int) + ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *) + ?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 12 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void) + ?GetConversationsFromServer@TConversationEngine@@AAEXXZ @ 13 NONAME ; void TConversationEngine::GetConversationsFromServer(void) + ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *, int) + ?tr@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString ConversationsEngine::tr(char const *, char const *, int) + ?qt_metacast@TConversationEngine@@UAEPAXPBD@Z @ 16 NONAME ; void * TConversationEngine::qt_metacast(char const *) + ?GetMessagingHistoryL@CCSRequestHandler@@QAEXH@Z @ 17 NONAME ; void CCSRequestHandler::GetMessagingHistoryL(int) + ?downloadOperationSupported@ConversationsEngine@@QAE_NH@Z @ 18 NONAME ; bool ConversationsEngine::downloadOperationSupported(int) + ?RemoveConversationListChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationListChangeObserver@@@Z @ 19 NONAME ; void CCSRequestHandler::RemoveConversationListChangeEventL(class MCsConversationListChangeObserver *) + ?GetConversationIdL@CCSRequestHandler@@QAEHH@Z @ 20 NONAME ; int CCSRequestHandler::GetConversationIdL(int) + ?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 21 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void) + ?getStaticMetaObject@TConversationEngine@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & TConversationEngine::getStaticMetaObject(void) + ?markConversationRead@ConversationsEngine@@QAE_N_J@Z @ 23 NONAME ; bool ConversationsEngine::markConversationRead(long long) + ?getCurrentConversationId@ConversationsEngine@@QAE_JXZ @ 24 NONAME ; long long ConversationsEngine::getCurrentConversationId(void) + ?ClearConversations@TConversationEngine@@AAEXXZ @ 25 NONAME ; void TConversationEngine::ClearConversations(void) + ?GetConversationIDFromContatcID@TConversationEngine@@AAEXXZ @ 26 NONAME ; void TConversationEngine::GetConversationIDFromContatcID(void) + ?CheckCurrentConversationID@TConversationEngine@@AAEXXZ @ 27 NONAME ; void TConversationEngine::CheckCurrentConversationID(void) + ?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 28 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void) + ?RequestConversationListChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationListChangeObserver@@@Z @ 29 NONAME ; void CCSRequestHandler::RequestConversationListChangeEventL(class MCsConversationListChangeObserver *) + ?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 30 NONAME ; void ConversationsEngine::conversationListModelPopulated(void) + ?ShutdownServerL@CCSRequestHandler@@QAEXXZ @ 31 NONAME ; void CCSRequestHandler::ShutdownServerL(void) + ?GetTotalUnreadCountL@CCSRequestHandler@@QAEKXZ @ 32 NONAME ; unsigned long CCSRequestHandler::GetTotalUnreadCountL(void) + ??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 33 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *) + ?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@1@Z @ 34 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &) + ?RemoveCachingStatusEventL@CCSRequestHandler@@QAEXPAVMCsCachingStatusObserver@@@Z @ 35 NONAME ; void CCSRequestHandler::RemoveCachingStatusEventL(class MCsCachingStatusObserver *) + ?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString ConversationsEngine::tr(char const *, char const *) + ?GetConversationListL@CCSRequestHandler@@QAEXXZ @ 37 NONAME ; void CCSRequestHandler::GetConversationListL(void) + ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 38 NONAME ; bool ConversationsEngine::getConversations(long long) + ?metaObject@TConversationEngine@@UBEPBUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const * TConversationEngine::metaObject(void) const + ?GetCachingStatusL@CCSRequestHandler@@QAEEXZ @ 40 NONAME ; unsigned char CCSRequestHandler::GetCachingStatusL(void) + ?RequestCachingStatusEventL@CCSRequestHandler@@QAEXPAVMCsCachingStatusObserver@@@Z @ 41 NONAME ; void CCSRequestHandler::RequestCachingStatusEventL(class MCsCachingStatusObserver *) + ?initTestCase@TConversationEngine@@AAEXXZ @ 42 NONAME ; void TConversationEngine::initTestCase(void) + ?GetConversationIDFromAddress@TConversationEngine@@AAEXXZ @ 43 NONAME ; void TConversationEngine::GetConversationIDFromAddress(void) + ?ClearMessagingHistoryL@CCSRequestHandler@@QAEXH@Z @ 44 NONAME ; void CCSRequestHandler::ClearMessagingHistoryL(int) + ?GetConversationsL@CCSRequestHandler@@QAEXPAVCCsClientConversation@@@Z @ 45 NONAME ; void CCSRequestHandler::GetConversationsL(class CCsClientConversation *) + ?NotifyModifyConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 46 NONAME ; void TConversationEngine::NotifyModifyConversationClientAndUpdateCLV(void) + ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 47 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) + ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 48 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?NotifyNewConversationEntryAndUpdateCV@TConversationEngine@@AAEXXZ @ 49 NONAME ; void TConversationEngine::NotifyNewConversationEntryAndUpdateCV(void) + ?deleteAllDraftMessages@ConversationsEngine@@QAEXXZ @ 50 NONAME ; void ConversationsEngine::deleteAllDraftMessages(void) + ?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 51 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString) + ?metaObject@ConversationsEngine@@UBEPBUQMetaObject@@XZ @ 52 NONAME ; struct QMetaObject const * ConversationsEngine::metaObject(void) const + ??1ConversationsEngine@@UAE@XZ @ 53 NONAME ; ConversationsEngine::~ConversationsEngine(void) + ?GetConversationIdFromAddressL@CCSRequestHandler@@QAEHAAVTDesC16@@@Z @ 54 NONAME ; int CCSRequestHandler::GetConversationIdFromAddressL(class TDesC16 &) + ?markAsReadAndGetType@ConversationsEngine@@QAEXHAAH0@Z @ 55 NONAME ; void ConversationsEngine::markAsReadAndGetType(int, int &, int &) + ?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 56 NONAME ; void * ConversationsEngine::qt_metacast(char const *) + ?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 57 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void) + ?MarkMessagingHistoryReadL@CCSRequestHandler@@QAEXH@Z @ 58 NONAME ; void CCSRequestHandler::MarkMessagingHistoryReadL(int) + ?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 59 NONAME ; void ConversationsEngine::conversationModelUpdated(void) + ?NewLC@CCSRequestHandler@@SAPAV1@XZ @ 60 NONAME ; class CCSRequestHandler * CCSRequestHandler::NewLC(void) + ?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void) + ?DeleteConversationAndUpdateCV@TConversationEngine@@AAEXXZ @ 62 NONAME ; void TConversationEngine::DeleteConversationAndUpdateCV(void) + ?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 63 NONAME ; bool ConversationsEngine::markMessagesRead(class QList &) + ?cleanupTestCase@TConversationEngine@@AAEXXZ @ 64 NONAME ; void TConversationEngine::cleanupTestCase(void) + ?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 65 NONAME ; void ConversationsEngine::conversationModelPopulated(void) + ?downloadMessage@ConversationsEngine@@QAEHH@Z @ 66 NONAME ; int ConversationsEngine::downloadMessage(int) + ?MarkConversationReadL@CCSRequestHandler@@QAEXH@Z @ 67 NONAME ; void CCSRequestHandler::MarkConversationReadL(int) + ?trUtf8@TConversationEngine@@SA?AVQString@@PBD0@Z @ 68 NONAME ; class QString TConversationEngine::trUtf8(char const *, char const *) + ?qt_metacall@TConversationEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int TConversationEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?GetDraftsModelFromConversationEngine@TConversationEngine@@AAEXXZ @ 70 NONAME ; void TConversationEngine::GetDraftsModelFromConversationEngine(void) + ?MarkConversationReadAndUpdateCV@TConversationEngine@@AAEXXZ @ 71 NONAME ; void TConversationEngine::MarkConversationReadAndUpdateCV(void) + ?init@TConversationEngine@@AAEXXZ @ 72 NONAME ; void TConversationEngine::init(void) + ?RemoveConversationChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationChangeObserver@@PAVCCsClientConversation@@@Z @ 73 NONAME ; void CCSRequestHandler::RemoveConversationChangeEventL(class MCsConversationChangeObserver *, class CCsClientConversation *) + ?cleanup@TConversationEngine@@AAEXXZ @ 74 NONAME ; void TConversationEngine::cleanup(void) + ??_EConversationsEngine@@UAE@I@Z @ 75 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int) + ?GetContactDetailsFromConversationID@TConversationEngine@@AAEXXZ @ 76 NONAME ; void TConversationEngine::GetContactDetailsFromConversationID(void) + ?RemoveResultsEventL@CCSRequestHandler@@QAEXPAVMCsResultsObserver@@@Z @ 77 NONAME ; void CCSRequestHandler::RemoveResultsEventL(class MCsResultsObserver *) + ?NotifyDeleteConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 78 NONAME ; void TConversationEngine::NotifyDeleteConversationClientAndUpdateCLV(void) + ?instance@ConversationsEngine@@SAPAV1@XZ @ 79 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void) + ?GetConversationUnreadListL@CCSRequestHandler@@QAEXPAV?$RPointerArray@VCCsClientConversation@@@@@Z @ 80 NONAME ; void CCSRequestHandler::GetConversationUnreadListL(class RPointerArray *) + ?RequestResultsEventL@CCSRequestHandler@@QAEXPAVMCsResultsObserver@@@Z @ 81 NONAME ; void CCSRequestHandler::RequestResultsEventL(class MCsResultsObserver *) + ?resendMessage@ConversationsEngine@@QAE_NH@Z @ 82 NONAME ; bool ConversationsEngine::resendMessage(int) + ?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 83 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void) + ?clearConversations@ConversationsEngine@@QAE_NXZ @ 84 NONAME ; bool ConversationsEngine::clearConversations(void) + ?Version@CCSRequestHandler@@QBE?AVTVersion@@XZ @ 85 NONAME ; class TVersion CCSRequestHandler::Version(void) const + ?NotifyConversationClientListAndUpdateCLV@TConversationEngine@@AAEXXZ @ 86 NONAME ; void TConversationEngine::NotifyConversationClientListAndUpdateCLV(void) + ?RequestConversationChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationChangeObserver@@PAVCCsClientConversation@@@Z @ 87 NONAME ; void CCSRequestHandler::RequestConversationChangeEventL(class MCsConversationChangeObserver *, class CCsClientConversation *) + ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 88 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) + ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 89 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject + ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 90 NONAME ; void ConversationsEngine::deleteMessages(class QList &) + ?NewL@CCSRequestHandler@@SAPAV1@XZ @ 91 NONAME ; class CCSRequestHandler * CCSRequestHandler::NewL(void) + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/eabi/testconversationengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/eabi/testconversationengineu.def Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,91 @@ +EXPORTS + _ZN17CCSRequestHandler15ShutdownServerLEv @ 1 NONAME + _ZN17CCSRequestHandler17GetCachingStatusLEv @ 2 NONAME + _ZN17CCSRequestHandler17GetConversationsLEP21CCsClientConversation @ 3 NONAME + _ZN17CCSRequestHandler18GetConversationIdLEi @ 4 NONAME + _ZN17CCSRequestHandler19DeleteConversationLEi @ 5 NONAME + _ZN17CCSRequestHandler19RemoveResultsEventLEP18MCsResultsObserver @ 6 NONAME + _ZN17CCSRequestHandler20GetConversationListLEv @ 7 NONAME + _ZN17CCSRequestHandler20GetMessagingHistoryLEi @ 8 NONAME + _ZN17CCSRequestHandler20GetTotalUnreadCountLEv @ 9 NONAME + _ZN17CCSRequestHandler20RequestResultsEventLEP18MCsResultsObserver @ 10 NONAME + _ZN17CCSRequestHandler21MarkConversationReadLEi @ 11 NONAME + _ZN17CCSRequestHandler22ClearMessagingHistoryLEi @ 12 NONAME + _ZN17CCSRequestHandler25MarkMessagingHistoryReadLEi @ 13 NONAME + _ZN17CCSRequestHandler25RemoveCachingStatusEventLEP24MCsCachingStatusObserver @ 14 NONAME + _ZN17CCSRequestHandler26GetConversationUnreadListLEP13RPointerArrayI21CCsClientConversationE @ 15 NONAME + _ZN17CCSRequestHandler26RequestCachingStatusEventLEP24MCsCachingStatusObserver @ 16 NONAME + _ZN17CCSRequestHandler29GetConversationIdFromAddressLER7TDesC16 @ 17 NONAME + _ZN17CCSRequestHandler30RemoveConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 18 NONAME + _ZN17CCSRequestHandler31RequestConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 19 NONAME + _ZN17CCSRequestHandler34RemoveConversationListChangeEventLEP33MCsConversationListChangeObserver @ 20 NONAME + _ZN17CCSRequestHandler35RequestConversationListChangeEventLEP33MCsConversationListChangeObserver @ 21 NONAME + _ZN17CCSRequestHandler4NewLEv @ 22 NONAME + _ZN17CCSRequestHandler5NewLCEv @ 23 NONAME + _ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME + _ZN19ConversationsEngine11qt_metacastEPKc @ 25 NONAME + _ZN19ConversationsEngine13resendMessageEi @ 26 NONAME + _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 27 NONAME + _ZN19ConversationsEngine14getDraftsModelEv @ 28 NONAME + _ZN19ConversationsEngine15downloadMessageEi @ 29 NONAME + _ZN19ConversationsEngine16getConversationsEx @ 30 NONAME + _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 31 NONAME + _ZN19ConversationsEngine16staticMetaObjectE @ 32 NONAME DATA 16 + _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 33 NONAME + _ZN19ConversationsEngine18clearConversationsEv @ 34 NONAME + _ZN19ConversationsEngine19deleteConversationsEx @ 35 NONAME + _ZN19ConversationsEngine19getStaticMetaObjectEv @ 36 NONAME + _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 37 NONAME + _ZN19ConversationsEngine20markConversationReadEx @ 38 NONAME + _ZN19ConversationsEngine21getConversationsModelEv @ 39 NONAME + _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 40 NONAME + _ZN19ConversationsEngine22fetchMoreConversationsEv @ 41 NONAME + _ZN19ConversationsEngine24conversationModelUpdatedEv @ 42 NONAME + _ZN19ConversationsEngine24getCurrentConversationIdEv @ 43 NONAME + _ZN19ConversationsEngine26conversationModelPopulatedEv @ 44 NONAME + _ZN19ConversationsEngine26downloadOperationSupportedEi @ 45 NONAME + _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 46 NONAME + _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 47 NONAME + _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 48 NONAME + _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 49 NONAME + _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 50 NONAME + _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 51 NONAME + _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 52 NONAME + _ZN19ConversationsEngine8instanceEv @ 53 NONAME + _ZN19ConversationsEngineC1EP7QObject @ 54 NONAME + _ZN19ConversationsEngineC2EP7QObject @ 55 NONAME + _ZN19ConversationsEngineD0Ev @ 56 NONAME + _ZN19ConversationsEngineD1Ev @ 57 NONAME + _ZN19ConversationsEngineD2Ev @ 58 NONAME + _ZN19TConversationEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 59 NONAME + _ZN19TConversationEngine11qt_metacastEPKc @ 60 NONAME + _ZN19TConversationEngine12initTestCaseEv @ 61 NONAME + _ZN19TConversationEngine15cleanupTestCaseEv @ 62 NONAME + _ZN19TConversationEngine16staticMetaObjectE @ 63 NONAME DATA 16 + _ZN19TConversationEngine18ClearConversationsEv @ 64 NONAME + _ZN19TConversationEngine19getStaticMetaObjectEv @ 65 NONAME + _ZN19TConversationEngine22FetchMoreConversationsEv @ 66 NONAME + _ZN19TConversationEngine26CheckCurrentConversationIDEv @ 67 NONAME + _ZN19TConversationEngine26GetConversationsFromServerEv @ 68 NONAME + _ZN19TConversationEngine28GetConversationIDFromAddressEv @ 69 NONAME + _ZN19TConversationEngine29DeleteConversationAndUpdateCVEv @ 70 NONAME + _ZN19TConversationEngine29FetchConversationsAndUpdateCVEv @ 71 NONAME + _ZN19TConversationEngine30GetConversationIDFromContatcIDEv @ 72 NONAME + _ZN19TConversationEngine31MarkConversationReadAndUpdateCVEv @ 73 NONAME + _ZN19TConversationEngine35GetContactDetailsFromConversationIDEv @ 74 NONAME + _ZN19TConversationEngine36GetDraftsModelFromConversationEngineEv @ 75 NONAME + _ZN19TConversationEngine37NotifyNewConversationEntryAndUpdateCVEv @ 76 NONAME + _ZN19TConversationEngine39NotifyNewConversationClientAndUpdateCLVEv @ 77 NONAME + _ZN19TConversationEngine40NotifyConversationClientListAndUpdateCLVEv @ 78 NONAME + _ZN19TConversationEngine42NotifyDeleteConversationClientAndUpdateCLVEv @ 79 NONAME + _ZN19TConversationEngine42NotifyModifyConversationClientAndUpdateCLVEv @ 80 NONAME + _ZN19TConversationEngine4initEv @ 81 NONAME + _ZN19TConversationEngine7cleanupEv @ 82 NONAME + _ZNK17CCSRequestHandler7VersionEv @ 83 NONAME + _ZNK19ConversationsEngine10metaObjectEv @ 84 NONAME + _ZNK19TConversationEngine10metaObjectEv @ 85 NONAME + _ZTI19ConversationsEngine @ 86 NONAME + _ZTI19TConversationEngine @ 87 NONAME + _ZTV19ConversationsEngine @ 88 NONAME + _ZTV19TConversationEngine @ 89 NONAME + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationengine.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,151 @@ +/* + * 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 T_CONVERSATIONENGINE_H_ +#define T_CONVERSATIONENGINE_H_ +#ifdef BUILD_TEST_DLL +#define TEST_EXPORT Q_DECL_EXPORT +#else +#define TEST_EXPORT Q_DECL_IMPORT +#endif + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class TConversationUpdateHandler; + + +class TEST_EXPORT TConversationEngine: public QObject +{ + Q_OBJECT + +private slots: + + /** + * Intializes component for testing + */ + void initTestCase(); + + /** + * Initilazes the test case data to be executed + */ + void init(); + + /** + * Fetches the conversation list from server + */ + void GetConversationsFromServer(); + + /** + * Fetches the conversation list and + * updates conversation view + */ + void FetchConversationsAndUpdateCV(); + + /** + * Checks current conversaton Id + */ + void CheckCurrentConversationID(); + + /** + * Mark the conversation status read + * and update conversation view + */ + void MarkConversationReadAndUpdateCV(); + + /** + * Delete the conversation and + * update conversation view + */ + void DeleteConversationAndUpdateCV(); + + /** + * Notify new conversation entry and + * update conversation view + */ + void NotifyNewConversationEntryAndUpdateCV(); + + /** + * Notify recieved conversation client list + * and update conversation list/summary view + */ + void NotifyConversationClientListAndUpdateCLV(); + + /** + * Get contact details from conversation id + */ + void GetContactDetailsFromConversationID(); + + /** + * Get conversation id from contact ID + */ + void GetConversationIDFromContatcID(); + + /** + * Notify Modified conversation client and update + * conversation summary list/summary view + */ + void NotifyModifyConversationClientAndUpdateCLV(); + + /** + * Notify Deleted conversation client + * and update conversation list/summary view + */ + void NotifyDeleteConversationClientAndUpdateCLV(); + + /** + * Notify new conversation client + * and update conversation list/summary view + */ + void NotifyNewConversationClientAndUpdateCLV(); + + /** + * Get conversation id from contact address + */ + void GetConversationIDFromAddress(); + + /** + * Fetch more conversations from server + */ + void FetchMoreConversations(); + + /** + * Clear conversation from conversation view + */ + void ClearConversations(); + + /** + * Get drafts model from conversation engine + */ + void GetDraftsModelFromConversationEngine(); + + /** + * Clean the test case data + */ + void cleanup(); + + /** + * Delete the initialized component for testing + */ + void cleanupTestCase(); + +private: + + TConversationUpdateHandler* iConvUpdateHandler; +}; +#endif /* T_CONVERSATIONENGINE_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationenginestub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationenginestub.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,224 @@ +/* + * 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 T_CONVERSATIONENGINESTUB_H_ +#define T_CONVERSATIONENGINESTUB_H_ + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class MCsResultsObserver; +class TestConversationNotifier; +class CCsConversationEntry; +class MCsConversationChangeObserver; +class MCsConversationListChangeObserver; +class CCsClientConversation; + + +class TestConversationEngineStub { + +public: + /** + * Returns pointer to sole instance. + * @return TestConversationEngineStub object + */ + static TestConversationEngineStub* Instance(); + + /** + * Destructor + */ + ~TestConversationEngineStub(); + +public: //stub client related functions for + //handling requests and commands from appengine + + /** + * Set result observer + */ + void SetResultObserver(MCsResultsObserver *aResultObserver); + + + /** + * Remove result observer + */ + void RemoveResultObserver(); + + /** + * Set conversation change observer + */ + void SetConversationChangeObserver(MCsConversationChangeObserver* aObserver, + CCsClientConversation* aClientConversation); + + /** + * Remove conversation change observer + */ + void RemoveConversationChangeObserver(); + + /** + * Set conversation list change observer + */ + void SetConversationListChangeObserver(MCsConversationListChangeObserver* + aConversationListChangeObserver); + + /** + * Remove conversation list change observer + */ + void RemoveConversationListChangeObserver(); + + /** + * Mark conversation as read associated with conversation id + */ + void MarkConversationRead(const TInt aConversationId); + + /** + * Delete conversation associated with conversation id + */ + void DeleteConversation(const TInt aConversationId); + + /** + * Get the client conversation id associated with contact id + */ + TInt GetClientConversationID(const TInt aContactId); + + /** + * Get the client conversation id associated with contact address + */ + TInt GetClientConversationID(const TDesC& aContactAddress); + +public: //stub notifications to appengine + + //Conversation list notification + void UpdateConversationList(); + + //Update modified Conversation entry + //to conversation change handler + void UpdateConvEntry(TInt aConversationId); + + //Update new added conversation entry + //to conversation change handler + void UpdateAddConvEntry(); + + //Update deleted conversation entry + //to conversation change handler + void UpdateDeletedConvEntry(); + + //conversation client list notification + void UpdateConversationClientList(); + + //Update new added conversation client + //to conversation list change handler + void UpdateAddConvClient(); + + //Update deleted conversation client + //to conversation list change handler + void UpdateDeletedConvClient(); + + //Update modified conversation client + //to conversation list change handler + void UpdateConvClient(TInt aConversationId); + +public: //test conversation engine validation functions + + //Get the conversation list size + TInt GetConvListSize(); + + //Get the unread message count + TInt GetUnreadCount(); + + //Get the current conversation id + TInt GetConversationID(); + + //Get the message time stamp + TInt GetTimeStamp(); + + //Get the message type + TInt GetMsgType(); + + //Get the contact id + TDesC& GetContactID(); + + //Get the message description + TDesC& GetDescription(); + + //Get the conversation client list + RPointerArray& GetConversationClientList(); + +private: + + /** + * Constructor + */ + TestConversationEngineStub(); + + /** + * Initializes the stub data + */ + void InitL(); + + /** + * Create conversation entry + */ + CCsConversationEntry* CreateConversationEntryL(TInt aConvID, bool aUnread); + + /** + * Prepare conversation list + */ + void PrepareConversationListL(TInt aConvID, TInt aToatalCnt, TInt aUnreadCnt); + + /** + * Create conversation client + */ + CCsClientConversation* + CreateConversationClientL(const HBufC* aDispName, TInt aContactID, + TInt aUnreadCnt, + CCsConversationEntry& aConvEntry); + + /** + * Prepare conversation client list + */ + void PrepareConversationClientListL(TInt aContactID, TInt aListSize, + TInt aUnRead, TInt aUnReadCnt); + + /** + * Update added conversation entry + */ + void UpdateAddConvEntryL(); + + /** + * Update added conversation client + */ + void UpdateAddConvClientL(); + +private://Data + TestConversationNotifier* iNotifier; + + //Test Conversation Stub Data + TInt iConversationID; + TInt iTimeStamp; + TInt iMsgType; + TInt iUnReadCount; + TBufC<12> iContactID; + TBufC<30> iDescription; + CCsConversationEntry* iDeletedEntry; + RPointerArray iConversationEntryList; + //Test Conversationclient Stub Data + RPointerArray iConversationClientList; +}; + +#endif /* T_CONVERSATIONENGINESTUB_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationnotifier.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,99 @@ +/* + * 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 T_CONVERSATIONNOTIFIER_H_ +#define T_CONVERSATIONNOTIFIER_H_ + +// INCLUDES +#include +#include + +//FARWARD DECLARATION +class MCsResultsObserver; +class MCsConversationListChangeObserver; +class CCsConversationChangeObserver; +class MCsCachingStatusObserver; +class CCsConversationEntry; +class CCsClientConversation; +class MCsConversationChangeObserver; + +class TestConversationNotifier { + +public: + TestConversationNotifier(); + + void SetResultNotifier(MCsResultsObserver* aResultsObserver); + + void RemoveResultNotifier(); + + void SetConversationListNotifier(MCsConversationListChangeObserver* aConversationListChangeObserver); + + void RemoveConversationListNotifier(); + + void SetConversationChangeNotifier(MCsConversationChangeObserver* aConversationChangeObserver); + + void RemoveConversationChangeNotifier(); + + void SetCachingStatusNotifier(MCsCachingStatusObserver* aCachingStatusObserver); + + void RemoveCachingStatusNotifier(); + + void SendListResultUpdate(RPointerArray& aConversationEntryList); + + void UpdateConversationEntryModify(CCsConversationEntry& aConversationEntry); + + void UpdateConversationEntryAdd(CCsConversationEntry& aConversationEntry); + + void UpdateConversationEntryDelete(CCsConversationEntry& aConversationEntry); + + void SendClientListUpdate(RPointerArray& aConversationClientList); + + void UpdateConversationClientModify(CCsClientConversation& aConversationClient); + + void UpdateConversationClientAdd(CCsClientConversation& aConversationClient); + + void UpdateConversationClientDelete(CCsClientConversation& aConversationClient); + +private: + /** + * iResultsObserver + * Observer which handles conversation event from server. + * Not Own. + */ + MCsResultsObserver* iResultsObserver; + + /** + * iConversationListChangeObserver + * Observer which handle conversation list changes. + * Not Own. + */ + MCsConversationListChangeObserver* iConversationListChangeObserver; + + /** + * iConversationChangeObserver + * Observer which handles conversation changes. + * Not Own. + */ + MCsConversationChangeObserver* iConversationChangeObserver; + + /** + * iCachingChangeObserver + * Observers which handle conversation change events from server. + * Not Own. + */ + MCsCachingStatusObserver* iCachingStatusObserver; +}; +#endif /* T_CONVERSATIONNOTIFIER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationupdatehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationupdatehandler.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,58 @@ +/* + * 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 T_CONVERSATIONUPDATEHANDLER_H_ +#define T_CONVERSATIONUPDATEHANDLER_H_ + +// INCLUDES +#include + + +class TConversationUpdateHandler : public QObject + { + Q_OBJECT +public: + + /** + * Constructor + */ + explicit TConversationUpdateHandler(QObject* parent = 0); + + /** + * Set the conversation view update handler + */ + void SetConversationsViewUpdateHandler(); + + /** + * Set the conversation summary view update handler + */ + void SetConversationsSummaryViewUpdateHandler(); + +private slots: + + /** + * Validates Conversation view on updation + */ + void ConversationsViewUpdated(); + + /** + * Validates Conversation summary view on updation + */ + void ConversationsSummaryViewUpdated(); + + }; +#endif /* T_CONVERSATIONUPDATEHANDLER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testccsrequesthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testccsrequesthandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,521 @@ +/* + * 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 FILES + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + + +//USER INCLUDES + +#include "ccsconversationchangeobserver.h" +#include "testconversationenginestub.h" + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C CCSRequestHandler* CCSRequestHandler::NewL() + { + + CCSRequestHandler* self = NewLC( ); + CleanupStack::Pop( self ); + + return( self ) ; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C CCSRequestHandler* CCSRequestHandler::NewLC(/*CVPbkContactManager* aVPbkContactManager*/) + { + + CCSRequestHandler* self = new ( ELeave ) CCSRequestHandler(); + CleanupStack::PushL( self ); + self->ConstructL(/*aVPbkContactManager*/); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::CCSAsyncRequestHandler() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +CCSRequestHandler::CCSRequestHandler() +: CActive( EPriorityStandard ) + { + + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +void CCSRequestHandler::ConstructL() + { + TestConversationEngineStub::Instance(); + + // Observers + iResultsObserver = NULL; + iCachingStatusObserver = NULL; + iConversationListChangeObserver = NULL; + iConversationChangeObserver = NULL; + + } + + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::~CCSRequestHandler() +// Destructor. +// ----------------------------------------------------------------------------- +CCSRequestHandler::~CCSRequestHandler() + { + + Cancel(); + + // Cleanup + if ( iBuffer ) + { + delete iBuffer; + iBuffer = NULL; + } + + if ( iResultsBuffer ) + { + delete iResultsBuffer; + iResultsBuffer = NULL; + } + + if ( iNotificationHandler ) + { + //delete iNotificationHandler; + iNotificationHandler = NULL; + } + + if( iListResultsBuffer ) + { + delete iListResultsBuffer; + iListResultsBuffer=NULL; + } + if( iConvResultsBuffer ) + { + delete iConvResultsBuffer; + iConvResultsBuffer=NULL; + } + + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleGetConversationListResults() +// This shall handle all entry list result from server +// +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleGetConversationListResults() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleGetConversationResults() +// This shall handle GetCoversation results async from server +// +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleGetConversationResults() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleGetEntryListOverflow() +// Handle the buffer overflow error for get entry list results +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleGetConversationListOverflow() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleGetConversationOverflow() +// Handle the buffer overflow error for get conversation results +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleGetConversationOverflow() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RequestResultsEventL() +// Add conversation result Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RequestResultsEventL( + MCsResultsObserver* aObserver) + { + iResultsObserver = aObserver; + TestConversationEngineStub::Instance()->SetResultObserver(aObserver); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RemoveResultsEventL() +// Remove conversation result observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RemoveResultsEventL +(MCsResultsObserver* /*aObserver*/) + { + iResultsObserver = NULL; + TestConversationEngineStub::Instance()->RemoveResultObserver(); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RequestConversationListChangeEventL() +// Add conversation list change event Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RequestConversationListChangeEventL( + MCsConversationListChangeObserver* aObserver) + { + iConversationListChangeObserver = aObserver; + TestConversationEngineStub::Instance()->SetConversationListChangeObserver(aObserver); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RemoveConversationListChangeEventL() +// Remove conversation list change event Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RemoveConversationListChangeEventL( + MCsConversationListChangeObserver* /*aObserver*/) + { + iConversationListChangeObserver = NULL; + TestConversationEngineStub::Instance()->RemoveConversationListChangeObserver(); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RequestConversationChangeEventL() +// Add conversation change event Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RequestConversationChangeEventL( + MCsConversationChangeObserver* aObserver, + CCsClientConversation* aClientConversation) + { + TestConversationEngineStub::Instance()->SetConversationChangeObserver(aObserver, aClientConversation); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RemoveConversationChangeEventL() +// Remove conversation change event observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RemoveConversationChangeEventL( + MCsConversationChangeObserver* /*aObserver*/, + CCsClientConversation* /*aClientConversation*/) + { + + if ( iConversationChangeObserver ) + { + TestConversationEngineStub::Instance()->RemoveConversationChangeObserver(); + delete iConversationChangeObserver; + iConversationChangeObserver = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RequestCachingStatusEventL() +// Add caching status Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RequestCachingStatusEventL( + MCsCachingStatusObserver* /*aObserver*/) + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RemoveCachingStatusEventL() +// Remove caching status Observer +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::RemoveCachingStatusEventL( + MCsCachingStatusObserver* /*aObserver*/) + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::RunL() +// Invoked to handle responses from the server. +// ----------------------------------------------------------------------------- +void CCSRequestHandler::RunL() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleErrorL() +// Send the error code to the client. +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleErrorL(TInt /*aErrorCode*/) + { + // Not supported + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::DoCancel() +// Cancels any outstanding operation. +// ----------------------------------------------------------------------------- +void CCSRequestHandler::DoCancel() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::Version() +// Recovers the conversation server version. +// ----------------------------------------------------------------------------- +EXPORT_C TVersion CCSRequestHandler::Version() const + { + TVersion ver(1, 2, 3); + return (ver); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::ShutdownServerL() +// Shuts down the conversation server. +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::ShutdownServerL() + { + //Do nothing + return; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationListL() +// Get Recent Conversation Entry list with display name +// for all stored conversation entry IDs. +// This API can be used to prepare conversation list view. +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::GetConversationListL() + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationUnreadListL() +// Get Recent unread Conversation Entry list with display name +// for all stored conversation entry IDs. +// This API can be used to prepare conversation list view. +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::GetConversationUnreadListL(RPointerArray< + CCsClientConversation>* /*aClientConversationList*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationsL() +// Get Conversation Entry list for given Conversation Entry ID to prepare +// convresation view. +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::GetConversationsL( + CCsClientConversation* aClientConversation) + { + // check if the aclientconversation is null then return + if ( !aClientConversation) + { + User::Leave(KErrArgument); + } + if (TestConversationEngineStub::Instance()->GetConversationID() + != aClientConversation->GetConversationEntryId()) + { + User::Leave(KErrNotFound); + } + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetCachingStatusL() +// Get caching status +// Synchronous +// ----------------------------------------------------------------------------- +EXPORT_C TUint8 CCSRequestHandler::GetCachingStatusL() + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetTotalUnreadCountL() +// Get total unread count +// Synchronous +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCSRequestHandler::GetTotalUnreadCountL() + { + TUint32 unreadCount = 10; + return unreadCount; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleAddConversationList() +// Process add conversation list event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleAddConversationList(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleDeleteConversationList() +// Process delete conversation lsit event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleDeleteConversationList(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleModifyConversationList +// Process modify conversation lsit event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleModifyConversationList(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleAddConversation +// Process add conversation event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleAddConversation(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleDeleteConversation +// Process delete conversation event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleDeleteConversation(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleModifyConversation +// Process Modify conversation event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleModifyConversation(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleCachingStarted +// Process caching started event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleCachingStarted(HBufC8* /*aResultsBuffer*/) + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleCachingCompleted +// Process caching completed event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleCachingCompleted(HBufC8* /*aResultsBuffer*/) + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleCachingError +// Process caching error event received from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleCachingError(HBufC8* /*aResultsBuffer*/) + { + User::Leave(KErrNotSupported); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::DeleteConversationL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::DeleteConversationL(TInt aConversationId) + { + TestConversationEngineStub::Instance()->DeleteConversation(aConversationId); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::HandleRefreshConversationList +// Process refresh from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleRefreshConversationList(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// Ccsrequesthandler::HandleRefreshConversationList +// Process refresh from server +// ----------------------------------------------------------------------------- +void CCSRequestHandler::HandleRefreshConversation(HBufC8* /*aResultsBuffer*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationIdL() +// ----------------------------------------------------------------------------- +EXPORT_C TInt CCSRequestHandler::GetConversationIdL(TInt aContactId) + { + TInt conversationId = -1; + + //Get the associated conversation id from the contact id + conversationId = TestConversationEngineStub::Instance()->GetClientConversationID(aContactId); + + return conversationId; + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationIdFromAddressL() +// ----------------------------------------------------------------------------- +EXPORT_C TInt CCSRequestHandler::GetConversationIdFromAddressL(TDesC& aContactAddress) + { + TInt conversationId = -1; + + //Read the conversation id from file with associated contact. + conversationId = TestConversationEngineStub::Instance()->GetClientConversationID(aContactAddress); + + return conversationId; + } +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetMessagingHistoryL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::GetMessagingHistoryL(TInt /*aContactId*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::GetConversationIdL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::ClearMessagingHistoryL(TInt /*aContactId*/) + { + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::MarkConversationReadL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::MarkConversationReadL(TInt aConversationId) + { + TestConversationEngineStub::Instance()->MarkConversationRead(aConversationId); + } + +// ----------------------------------------------------------------------------- +// CCSRequestHandler::MarkMessagingHistoryReadL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCSRequestHandler::MarkMessagingHistoryReadL(TInt /*aContactId*/) + { + } + +// End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationengine.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,322 @@ +/* + * 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: + * + */ + +// INCLUDES +#include "conversationsengine.h" +#include "testconversationengine.h" +#include "testconversationenginestub.h" +#include "testconversationenginestub.h" +#include "testconversationupdatehandler.h" +#include +#include +#include +#include + + +void TConversationEngine::initTestCase() +{ + iConvUpdateHandler = new TConversationUpdateHandler(); + QVERIFY2(ConversationsEngine::instance() != NULL, "Appengine is not initialized."); + QVERIFY2(TestConversationEngineStub::Instance() != NULL, "Appengine Stub is not initialized."); + +} + +void TConversationEngine::init() +{ + // allocate, setup the neccessary environment for + // current test case to execute +} + +// fetch the conversations from server +void TConversationEngine::GetConversationsFromServer() +{ + QVERIFY2(ConversationsEngine::instance()-> + getConversations(TestConversationEngineStub::Instance()-> + GetConversationID()), "Get conversations failed"); +} + +//fetch the coversation and validate conversation view +void TConversationEngine::FetchConversationsAndUpdateCV() +{ + QVERIFY2(ConversationsEngine::instance()-> + getConversations(TestConversationEngineStub::Instance()-> + GetConversationID()), "Get conversations failed"); + + //should be used once, will work for all the test cases + iConvUpdateHandler->SetConversationsViewUpdateHandler(); + + //listen for emitted signal + QSignalSpy convListUpdate(ConversationsEngine::instance(), + SIGNAL(conversationModelPopulated())); + + // Now we check to make sure we don't have any signals already + QCOMPARE( convListUpdate.count(), 0 ); + + //update the coversation model and + //wait for active object to execute + TestConversationEngineStub::Instance()->UpdateConversationList(); + QTest::qWait(2000); + + //conversation engine should have emitted signal + QCOMPARE( convListUpdate.count(), 1 ); +} + +//validate the current conversation id +void TConversationEngine::CheckCurrentConversationID() +{ + QVERIFY2((ConversationsEngine::instance()->getCurrentConversationId() + == TestConversationEngineStub::Instance()->GetConversationID()), + "Current conversation id mismatch"); +} + +//mark the conversation as read and validate the conversation view +void TConversationEngine::MarkConversationReadAndUpdateCV() +{ + //mark the conversation as read + ConversationsEngine::instance()-> + markConversationRead(TestConversationEngineStub::Instance()-> + GetConversationID()); + + //listen for emitted signal + QSignalSpy convModify(ConversationsEngine::instance(), + SIGNAL(conversationModelUpdated())); + + // Now we check to make sure we don't have any signals already + QCOMPARE( convModify.count(), 0 ); + + // update the conversation view with modified conversation + TestConversationEngineStub::Instance()-> + UpdateConvEntry(TestConversationEngineStub::Instance()-> + GetConversationID()); + + //conversation engine should have emitted signal + QCOMPARE( convModify.count(), 1 ); +} + +//delete the conversation and validate updetad conversation view +void TConversationEngine::DeleteConversationAndUpdateCV() +{ + // delete the conversation entry + ConversationsEngine::instance()-> + deleteConversations(TestConversationEngineStub::Instance()-> + GetConversationID()); + + //listen for emitted signal + QSignalSpy convDelete(ConversationsEngine::instance(), + SIGNAL(conversationModelUpdated())); + + // Now we check to make sure we don't have any signals already + QCOMPARE( convDelete.count(), 0 ); + + // update the conversation view with deleted entry + TestConversationEngineStub::Instance()->UpdateDeletedConvEntry(); + + //conversation engine should have emitted signal + QCOMPARE( convDelete.count(), 1 ); +} + +//notify new recieved conversation and validate conversation view +void TConversationEngine::NotifyNewConversationEntryAndUpdateCV() +{ + //listen for emitted signal + QSignalSpy convAdd(ConversationsEngine::instance(), + SIGNAL(conversationModelUpdated())); + + // Now we check to make sure we don't have any signals already + QCOMPARE( convAdd.count(), 0 ); + + TestConversationEngineStub::Instance()->UpdateAddConvEntry(); + + //conversation engine should have emitted signal + QCOMPARE( convAdd.count(), 1 ); +} + +//update conversation client list and validate conversation summary model +void TConversationEngine::NotifyConversationClientListAndUpdateCLV() +{ + //should be used once, will work for all the test cases + //set the conversation summary view update handler + iConvUpdateHandler->SetConversationsSummaryViewUpdateHandler(); + + //listen for emitted signal + QSignalSpy convClientList(ConversationsEngine::instance(), + SIGNAL(conversationListModelPopulated())); + + // Now we check to make sure we don't have any signals already + QCOMPARE( convClientList.count(), 0 ); + + //update the conversation client list to summary model + TestConversationEngineStub::Instance()->UpdateConversationClientList(); + QTest::qWait(2000); + + //conversation engine should have emitted signal + QCOMPARE( convClientList.count(), 1 ); +} + +//get contactt details associated with conversation id +void TConversationEngine::GetContactDetailsFromConversationID() +{ + //get the conversation client list + RPointerArray& clientList + = TestConversationEngineStub::Instance()->GetConversationClientList(); + + //match the client list with summary model list + for (int loop = 0; loop < clientList.Count(); loop++) + { + CCsClientConversation* clientConv = clientList[loop]; + + qint64 msgId = clientConv->GetConversationEntryId(); + + QString fname; + QString address; + + ConversationsEngine::instance()-> + getContactDetails(msgId, fname, address); + + qDebug() << "msgId " << msgId; + + //check the bunch of converation client details + QCOMPARE(fname, + S60QConversions::s60DescToQString( + *(clientConv->GetDisplayName()))); + + QCOMPARE(address, + S60QConversions::s60DescToQString( + *(clientConv->GetConversationEntry()->Contact()))); + } +} + +// get conversation id associated with contact id +void TConversationEngine::GetConversationIDFromContatcID() +{ + //get the conversation client list + RPointerArray& clientList + = TestConversationEngineStub::Instance()->GetConversationClientList(); + + //match the client list with summary model list + for (int loop = 0; loop < clientList.Count(); loop++) + { + CCsClientConversation* clientConv = clientList[loop]; + + qint64 msgId = clientConv->GetConversationEntryId(); + + qint64 convID = ConversationsEngine::instance()-> + getConversationIdFromContactId(clientConv->GetContactId()); + QCOMPARE(convID, msgId); + } +} + +// update the new conversation client to summary view +void TConversationEngine::NotifyNewConversationClientAndUpdateCLV() +{ + //Add and update new conversation client to summary model + TestConversationEngineStub::Instance()->UpdateAddConvClient(); + + //emit the signal for validating the summary model + ConversationsEngine::instance()->emitConversationListModelPopulated(); +} + +//update the modified conversation client +void TConversationEngine::NotifyModifyConversationClientAndUpdateCLV() +{ + //update the modified conversation client to summary model + TestConversationEngineStub::Instance()-> + UpdateConvClient(TestConversationEngineStub::Instance()->GetConversationID()); + + //emit the signal for validating the summary model + ConversationsEngine::instance()->emitConversationListModelPopulated(); +} + +//update the deleted conversation client +void TConversationEngine::NotifyDeleteConversationClientAndUpdateCLV() +{ + //update the deleted conversation client to summary model + TestConversationEngineStub::Instance()->UpdateDeletedConvClient(); + + //emit the signal for validating the summary model + ConversationsEngine::instance()->emitConversationListModelPopulated(); +} + +//get the conversation id from address +void TConversationEngine::GetConversationIDFromAddress() +{ + //get the conversation client list + RPointerArray& clientList + = TestConversationEngineStub::Instance()->GetConversationClientList(); + + //math the conversation id recieved from summary model + if (clientList.Count()) + { + qint64 msgId = clientList[0]->GetConversationEntryId(); + + QStandardItemModel* convModel = ConversationsEngine::instance()-> + getConversationsSummaryModel(); + + //match convid in model, if not found raise error + QModelIndexList indexList = convModel->match(convModel->index(0, 0), + ConversationId, msgId, 1, Qt::MatchExactly); + + QVERIFY2(indexList.count(), "No item found in summary model"); + + qint64 convID = ConversationsEngine::instance()-> + getConversationIdFromAddress( + convModel->data(indexList[0], ConversationAddress).toString()); + QCOMPARE(convID, msgId); + } +} + +//fetch more conversations from server +void TConversationEngine::FetchMoreConversations() +{ + ConversationsEngine::instance()->fetchMoreConversations(); +} + +//clear conversations from conversation view +void TConversationEngine::ClearConversations() +{ + //clear the conversations + ConversationsEngine::instance()->clearConversations(); + + //validate the conversation view, and raise the error if entry found + QStandardItemModel* convModel + = ConversationsEngine::instance()->getConversationsModel(); + QVERIFY2(convModel->rowCount() == 0, "conversation view not cleared"); +} + +//get the drafts model +void TConversationEngine::GetDraftsModelFromConversationEngine() +{ + QStandardItemModel* convModel + = ConversationsEngine::instance()->getDraftsModel(); + QVERIFY2(convModel, "Get Drafts Model Failed"); +} + +void TConversationEngine::cleanup() +{ + //clean the resources for the current test case +} + +void TConversationEngine::cleanupTestCase() +{ + //delete the update handler + delete iConvUpdateHandler; + iConvUpdateHandler = NULL; + //delete the conversation engine variable + delete ConversationsEngine::instance(); + //delete the stub data + delete TestConversationEngineStub::Instance(); +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationenginestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationenginestub.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include "testconversationenginestub.h" +#include "testconversationnotifier.h" +#include "convergedmessage.h" + +TestConversationEngineStub* TestConversationEngineStub::Instance() +{ + static TestConversationEngineStub* iStubEngine + = new TestConversationEngineStub(); + return iStubEngine; +} + +void TestConversationEngineStub::InitL() +{ + iNotifier = new TestConversationNotifier(); + iConversationID = 1234; + iTimeStamp = 123456789; + iMsgType = ECsSMS; + iUnReadCount = 3; + + _LIT(Kname , "9343434343"); + _LIT(KDescription , "This is the test msg."); + + iContactID = Kname; + iDescription = KDescription; + iDeletedEntry = NULL; +} + +TestConversationEngineStub::TestConversationEngineStub() +{ + TRAP_IGNORE(InitL()); +} + +TestConversationEngineStub::~TestConversationEngineStub() +{ + iConversationClientList.ResetAndDestroy(); + iConversationEntryList.ResetAndDestroy(); + delete iNotifier; +} + +void TestConversationEngineStub +::SetResultObserver(MCsResultsObserver *aResultObserver) +{ + iNotifier->SetResultNotifier(aResultObserver); +} + +void TestConversationEngineStub::RemoveResultObserver() +{ + iNotifier->RemoveResultNotifier(); +} + +void TestConversationEngineStub +::SetConversationChangeObserver(MCsConversationChangeObserver* aObserver, + CCsClientConversation* /*aClientConversation*/) +{ + iNotifier->SetConversationChangeNotifier(aObserver); +} + +void TestConversationEngineStub::RemoveConversationChangeObserver() +{ + iNotifier->RemoveConversationChangeNotifier(); +} + +void TestConversationEngineStub +::SetConversationListChangeObserver(MCsConversationListChangeObserver* + aConversationListChangeObserver) +{ + iNotifier->SetConversationListNotifier(aConversationListChangeObserver); +} + +void TestConversationEngineStub::RemoveConversationListChangeObserver() +{ + iNotifier->RemoveConversationListNotifier(); +} + +void TestConversationEngineStub +::MarkConversationRead(const TInt aConversationId) +{ + for (TInt i = 0; i < iConversationEntryList.Count(); ++i) + { + if (iConversationEntryList[i]->EntryId() == aConversationId) + { + iConversationEntryList[i]-> + ChangeAttributes(ECsAttributeNone, ECsAttributeUnread); + break; + } + } +} + +void TestConversationEngineStub +::DeleteConversation(const TInt aConversationId) +{ + for (TInt i = 0; i < iConversationEntryList.Count(); ++i) + { + if (iConversationEntryList[i]->EntryId() == aConversationId) + { + iDeletedEntry = iConversationEntryList[i]; + iConversationEntryList.Remove(i); + } + } +} + +TInt TestConversationEngineStub::GetConvListSize() +{ + return iConversationEntryList.Count(); +} + +TInt TestConversationEngineStub::GetUnreadCount() +{ + TInt unRead = 0; + for (TInt i = 0; i < iConversationEntryList.Count(); ++i) + { + if (iConversationEntryList[i]->IsAttributeSet(ECsAttributeUnread)) + { + unRead++; + } + } + return unRead; +} + +TInt TestConversationEngineStub::GetConversationID() +{ + return iConversationID; +} + +TInt TestConversationEngineStub::GetTimeStamp() +{ + return iTimeStamp; +} + +TInt TestConversationEngineStub::GetMsgType() +{ + return iMsgType; +} + +TDesC& TestConversationEngineStub::GetContactID() +{ + return iContactID; +} + +TDesC& TestConversationEngineStub::GetDescription() +{ + return iDescription; +} + +RPointerArray& +TestConversationEngineStub::GetConversationClientList() +{ + return iConversationClientList; +} + +CCsConversationEntry* +TestConversationEngineStub +::CreateConversationEntryL(TInt aConvID, bool aUnread) +{ + CCsConversationEntry* conversationEntry = CCsConversationEntry::NewL(); + CleanupStack::PushL(conversationEntry); + + conversationEntry->SetType(iMsgType); + conversationEntry->SetEntryId(aConvID); + + conversationEntry->SetTimeStampL(iTimeStamp); + + conversationEntry->SetContactL(iContactID); + + conversationEntry->SetDescriptionL(iDescription); + + if (aUnread) + { + conversationEntry->ChangeAttributes(ECsAttributeUnread, + ECsAttributeNone); + conversationEntry->SetConversationDir(0/*MsgDirectionIncoming*/); + } + else + { + conversationEntry->SetConversationDir(1/*MsgDirectionOutgoing*/); + conversationEntry->ChangeAttributes(ECsAttributeSent, + ECsAttributeNone); + } + + CleanupStack::Pop(conversationEntry); + + return conversationEntry; +} + +void TestConversationEngineStub +::PrepareConversationListL(TInt aConvID, TInt aToatalCnt, TInt aUnreadCnt) +{ + // create conversation entries + for ( TInt iloop = 0; iloop < aToatalCnt; iloop++ ) + { + CCsConversationEntry* conversationEntry + = CreateConversationEntryL(aConvID++, (aUnreadCnt-- > 0)); + CleanupStack::PushL(conversationEntry); + + // append conversation entries to list + iConversationEntryList.AppendL(conversationEntry); + + CleanupStack::Pop(conversationEntry); + } +} + +//Prerae a list with : conv id, no of unread msgs, +void TestConversationEngineStub::UpdateConversationList() +{ + TInt error; + TRAP(error, PrepareConversationListL(iConversationID, 5, iUnReadCount)); + iNotifier->SendListResultUpdate(iConversationEntryList); +} + +void TestConversationEngineStub::UpdateConvEntry(TInt aConversationId) +{ + for (TInt i = 0; i < iConversationEntryList.Count(); ++i) + { + if (iConversationEntryList[i]->EntryId() == aConversationId) + { + iNotifier-> + UpdateConversationEntryModify(*iConversationEntryList[i]); + break; + } + } +} + +void TestConversationEngineStub::UpdateDeletedConvEntry() +{ + if (iDeletedEntry) + { + iNotifier->UpdateConversationEntryDelete(*iDeletedEntry); + delete iDeletedEntry; + iDeletedEntry = NULL; + } +} + +void TestConversationEngineStub::UpdateAddConvEntryL() +{ + CCsConversationEntry* + conversationEntry = CreateConversationEntryL(9999/*iConversationID - 1*/, true); + CleanupStack::PushL(conversationEntry); + iConversationEntryList.AppendL(conversationEntry); + CleanupStack::Pop(conversationEntry); + iNotifier->UpdateConversationEntryAdd(*conversationEntry); +} + +void TestConversationEngineStub::UpdateAddConvEntry() +{ + TInt error; + TRAP(error, UpdateAddConvEntryL()); +} + +void TestConversationEngineStub::UpdateAddConvClientL() +{ + _LIT(KFName , "New User"); + + //need to free alloced descriptor + TBuf<10> BufName(KFName); + HBufC * fname = BufName.AllocL(); + CleanupStack::PushL(fname); + + CCsConversationEntry* + convEntry = CreateConversationEntryL(iConversationID - 1, true); + CleanupStack::PushL(convEntry); + + CCsClientConversation* + convClient = CreateConversationClientL(fname,4000, 2, *convEntry); + CleanupStack::PushL(convClient); + + iConversationClientList.AppendL(convClient); + + CleanupStack::Pop(convClient); + CleanupStack::PopAndDestroy(convEntry); + CleanupStack::PopAndDestroy(fname); + iNotifier->UpdateConversationClientAdd(*convClient); +} + +void TestConversationEngineStub::UpdateAddConvClient() +{ + TInt error; + TRAP(error, UpdateAddConvClientL()); +} + +void TestConversationEngineStub::UpdateDeletedConvClient() +{ + CCsClientConversation* convClient = iConversationClientList[0]; + iConversationClientList.Remove(0); + + if (convClient) + { + iNotifier->UpdateConversationClientDelete(*convClient); + delete convClient; + } +} + + +void TestConversationEngineStub::UpdateConvClient(TInt aConversationId) +{ + for (TInt i = 0; i < iConversationClientList.Count(); ++i) + { + if (iConversationClientList[i]->GetConversationEntryId() + == aConversationId) + { + iConversationClientList[i]-> + GetConversationEntry()-> + ChangeAttributes(ECsAttributeNone, ECsAttributeUnread); + + iConversationClientList[i]->SetUnreadMessageCount(0); + + iNotifier-> + UpdateConversationClientModify(*iConversationClientList[i]); + break; + } + } +} + +CCsClientConversation* +TestConversationEngineStub:: +CreateConversationClientL(const HBufC* aDispName, TInt aContactID, + TInt aUnreadCnt, + CCsConversationEntry& aConvEntry) +{ + CCsClientConversation* conversationClient = CCsClientConversation::NewL(); + CleanupStack::PushL(conversationClient); + + conversationClient->SetContactId(aContactID); + conversationClient->SetUnreadMessageCount(aUnreadCnt); + + conversationClient->SetDisplayNameL(aDispName); + + conversationClient->SetConversationEntryL(&aConvEntry); + + conversationClient->SetConversationEntryId(aConvEntry.EntryId()); + + CleanupStack::Pop(conversationClient); + + return conversationClient; +} + +void TestConversationEngineStub +::PrepareConversationClientListL(TInt aContactID, TInt aListSize, + TInt aUnRead, TInt aUnReadCnt) +{ + TInt convID = iConversationID; + + _LIT(KFName , "abc"); + + //need to free alloced descriptor + TBufC<10> BufName(KFName); + HBufC * fname = BufName.AllocL(); + CleanupStack::PushL(fname); + + for (TInt loop = 0; loop < aListSize; loop++) + { + CCsConversationEntry* + convEntry = CreateConversationEntryL(convID++, + (aUnRead-- > 0 ? true : false)); + CleanupStack::PushL(convEntry); + + CCsClientConversation* + convClient = CreateConversationClientL(fname, aContactID++, aUnReadCnt++, + *convEntry); + CleanupStack::PushL(convClient); + + iConversationClientList.AppendL(convClient); + + CleanupStack::Pop(convClient); + CleanupStack::PopAndDestroy(convEntry); + } + CleanupStack::Pop(fname); +} + +//conversation client notifications +void TestConversationEngineStub::UpdateConversationClientList() +{ + TInt error; + TRAP(error, PrepareConversationClientListL(2000, 5, 3, 0)); + if (error == KErrNone) + { + iNotifier->SendClientListUpdate(iConversationClientList); + } +} + +TInt TestConversationEngineStub +::GetClientConversationID(const TInt aContactId) +{ + for (TInt i = 0; i < iConversationClientList.Count(); ++i) + { + if (iConversationClientList[i]->GetContactId() == aContactId) + { + return iConversationClientList[i]->GetConversationEntryId(); + } + } + return -1; +} + +TInt TestConversationEngineStub +::GetClientConversationID(const TDesC& aContactAddress) +{ + for (TInt i = 0; i < iConversationClientList.Count(); ++i) + { + if (iConversationClientList[i]-> + GetConversationEntry()-> + Contact()->Compare(aContactAddress) == 0) + { + return iConversationClientList[i]->GetConversationEntryId(); + } + } + return -1; +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationnotifier.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,161 @@ +/* + * 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 "testconversationnotifier.h" + +#include +#include +#include +#include + + +TestConversationNotifier::TestConversationNotifier() + :iResultsObserver(NULL), + iConversationListChangeObserver(NULL), + iConversationChangeObserver(NULL), + iCachingStatusObserver(NULL) +{ +} + +void TestConversationNotifier +::SetResultNotifier(MCsResultsObserver* aResultsObserver) +{ + iResultsObserver = aResultsObserver; +} + +void TestConversationNotifier::RemoveResultNotifier( ) +{ + iResultsObserver = NULL; +} + +void TestConversationNotifier +::SetConversationListNotifier(MCsConversationListChangeObserver* + aConversationListChangeObserver) +{ + iConversationListChangeObserver = aConversationListChangeObserver; +} + +void TestConversationNotifier::RemoveConversationListNotifier( ) +{ + iConversationListChangeObserver = NULL; +} + +void TestConversationNotifier +::SetConversationChangeNotifier(MCsConversationChangeObserver* + aConversationChangeObserver) +{ + iConversationChangeObserver = aConversationChangeObserver; +} + +void TestConversationNotifier::RemoveConversationChangeNotifier() +{ + iConversationChangeObserver = NULL; +} + +void TestConversationNotifier +::SetCachingStatusNotifier(MCsCachingStatusObserver* aCachingStatusObserver) +{ + iCachingStatusObserver = aCachingStatusObserver; +} + +void TestConversationNotifier::RemoveCachingStatusNotifier() +{ + iCachingStatusObserver = NULL; +} + +void TestConversationNotifier +::SendListResultUpdate(RPointerArray& + aConversationEntryList) +{ + // Pass the results to the observer + if ( iResultsObserver ) + { + iResultsObserver->Conversations(aConversationEntryList); + } +} + +void TestConversationNotifier +::UpdateConversationEntryModify(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->ModifyConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::UpdateConversationEntryAdd(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->AddConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::UpdateConversationEntryDelete(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->DeleteConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::SendClientListUpdate(RPointerArray& + aConversationClientList) +{ + // Pass the results to the observer + if ( iResultsObserver ) + { + iResultsObserver->ConversationList(aConversationClientList); + } +} + +void TestConversationNotifier +::UpdateConversationClientModify(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + ModifyConversationList(aConversationClient); + } +} + +void TestConversationNotifier +::UpdateConversationClientAdd(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + AddConversationList(aConversationClient); + } +} + +void TestConversationNotifier +::UpdateConversationClientDelete(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + DeleteConversationList(aConversationClient); + } +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationupdatehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationupdatehandler.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,155 @@ +/* + * 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 "testconversationupdatehandler.h" +#include "testconversationenginestub.h" +#include "conversationsengine.h" +#include +#include +#include +#include +#include + + +TConversationUpdateHandler::TConversationUpdateHandler(QObject* parent) +: QObject(parent) +{ + +} + + +void TConversationUpdateHandler::SetConversationsViewUpdateHandler() +{ + connect(ConversationsEngine::instance(), + SIGNAL(conversationModelPopulated()), + this, + SLOT(ConversationsViewUpdated())); + + connect(ConversationsEngine::instance(), + SIGNAL(conversationModelUpdated()), + this, + SLOT(ConversationsViewUpdated())); +} + +void TConversationUpdateHandler::SetConversationsSummaryViewUpdateHandler() +{ + connect(ConversationsEngine::instance(), + SIGNAL(conversationListModelPopulated()), + this, + SLOT(ConversationsSummaryViewUpdated())); +} + +void TConversationUpdateHandler::ConversationsViewUpdated() +{ + int loop, entryCount, unRead = 0; + + QWARN("List is updated to ..Conversation Model"); + + //Need to compare the Msglist with stub engine + QStandardItemModel* convModel = ConversationsEngine::instance()->getConversationsModel(); + + //get the list with conversation address, + //as this is common for all the conversation entries + QModelIndexList indexList = convModel->match(convModel->index(0, 0), + ConversationAddress, + S60QConversions::s60DescToQString(TestConversationEngineStub::Instance()->GetContactID()), + -1, // One match + Qt::MatchExactly); + entryCount = indexList.count(); + + qDebug() << "entry count " << entryCount; + qDebug() << "row count " << convModel->rowCount(); + + QCOMPARE(entryCount, + TestConversationEngineStub::Instance()->GetConvListSize()); + + //match all the entries with stub conversation list + for(loop = 0; loop < entryCount; loop++) + { + //check for bunch of conversation fields and attributes + QCOMPARE(convModel->data(indexList[loop], MessageType).toInt(), + TestConversationEngineStub::Instance()->GetMsgType()); + + //compare the message description + QCOMPARE(convModel->data(indexList[loop], BodyText).toString(), + S60QConversions::s60DescToQString( + TestConversationEngineStub::Instance()-> + GetDescription())); + + //check the unread message status + if (convModel->data(indexList[loop], UnReadStatus).toBool()) + { + unRead++; + } + + qDebug() << "Conversation IDs " << convModel->data(indexList[loop], ConvergedMsgId).toInt(); + } + + //check the unread messages count + QCOMPARE(unRead, TestConversationEngineStub::Instance()->GetUnreadCount()); +} + +void TConversationUpdateHandler::ConversationsSummaryViewUpdated() +{ + QWARN("List is updated to ..Conversation Summary Model"); + + //get the conversation client list + RPointerArray& clientList + = TestConversationEngineStub::Instance()->GetConversationClientList(); + + //get the converation summary model + QStandardItemModel* convModel = ConversationsEngine::instance()->getConversationsSummaryModel(); + + //list size and rows in conversation model must be the same + QCOMPARE(convModel->rowCount(), clientList.Count()); + + + //match all the client entries with stub conversation client list + for (int loop = 0; loop < clientList.Count(); loop++) + { + CCsClientConversation* clientConv = clientList[loop]; + + qint64 msgId = clientConv->GetConversationEntryId(); + + //match convId in model, if not found raise error + QModelIndexList indexList = convModel->match(convModel->index(0, 0), + ConversationId, msgId, 1, Qt::MatchExactly); + + qDebug() << "msgId " << msgId; + qDebug() << "index list " << indexList.count(); + + if (indexList.count() == 0) + { + QFAIL("Conv client not found"); + } + + //check the bunch of converation client details + + int msgCnt = clientConv->GetUnreadMessageCount(); + QCOMPARE(convModel->data(indexList[0], UnreadCount).toInt(), msgCnt); + + TDesC* dispName = clientConv->GetDisplayName(); + QCOMPARE(convModel->data(indexList[0], DisplayName).toString(), + S60QConversions::s60DescToQString(*dispName)); + + int contactId = clientConv->GetContactId(); + QCOMPARE(convModel->data(indexList[0], ContactId).toInt(), contactId); + + //need to check the conversation entry + } + } + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testrcssession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testrcssession.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,238 @@ +/* + * 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 FILES + +// SYSTEM INCLUDES +#include + +// USER INCLUDES + +// ---------------------------------------------------------------------------- +// StartServer +// Starts the server. Used only when the server is implemented as a transient. +// ---------------------------------------------------------------------------- +TInt StartServer() +{ + return KErrNone; +} +// ============================== MEMBER FUNCTIONS ============================ + +// ---------------------------------------------------------------------------- +// RCsSession::RCsSession +// Constructor +// ---------------------------------------------------------------------------- +RCsSession::RCsSession() : RSessionBase(), +iListResultsBufferPtr (0, 0), +iConvResultsBufferPtr (0, 0), +iRequestBufferPtr (0, 0), +iNotifyResultsBufferPtr (0, 0), +iNotifyRequestBufferPtr (0, 0){ +} + +// ---------------------------------------------------------------------------- +// RCsSession::Connects to the conversation server +// Returns the version number +// ---------------------------------------------------------------------------- +TInt RCsSession::Connect() +{ + return KErrNone; +} + +// ---------------------------------------------------------------------------- +// RCsSession::Version +// Returns the version number +// ---------------------------------------------------------------------------- +TVersion RCsSession::Version() const +{ + TVersion ver(1,2,3); + return ver; +} + +// ---------------------------------------------------------------------------- +// RCsSession::ShutdownServerL +// Shutsdown the CS Server. Synchronous. +// ---------------------------------------------------------------------------- +void RCsSession::ShutdownServerL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetConversationListL +// This function sends the request to conversation server +// to get Recent Conversation Entry list with display name and contact link +// for all stored conversation entry IDs. +// ---------------------------------------------------------------------------- +void RCsSession::GetConversationListL(TPtr8 /*aResultsBuffer*/, + TRequestStatus& /*aStatus*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetConversationUnreadListL +// This function sends the request to conversation server +// to get Recent unread Conversation Entry list with display name and contact link +// for all stored conversation entry IDs. +// ---------------------------------------------------------------------------- +void RCsSession::GetConversationUnreadListL(TPtr8 /*aOverflow*/, TPtr8 /*aResultsBuffer*/) + { + } + +// ---------------------------------------------------------------------------- +// RCsSession::GetConversationsL +// This function sends the request to conversation server +// to get Conversation Entry list for given Conversation Entry ID. +// ---------------------------------------------------------------------------- +void RCsSession::GetConversationsL(const TDes8& /*aClientConversation*/, + TPtr8 /*aResultsBuffer*/, + TRequestStatus& /*aStatus*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::SendNewBufferGetConversationL +// This function sends the request to conversation server +// to get whole conversation again for the new buffer size +// +// ---------------------------------------------------------------------------- +void RCsSession::SendNewBufferGetConversationL(TPtr8 /*aResultsBuffer*/, + TRequestStatus& /*aStatus*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetCachingStatusL +// This function sends the request to conversation server +// to get caching status. +// ---------------------------------------------------------------------------- +void RCsSession::GetCachingStatusL(TPtr8 /*aResultsBuffer*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetTotalUnreadCountL +// This function sends the request to conversation server +// to get caching status. +// ---------------------------------------------------------------------------- +void RCsSession::GetTotalUnreadCountL(TPtr8 /*aResultsBuffer*/) + { + } + +// ---------------------------------------------------------------------------- +// RCsSession::SetConversationListChangeObserverL +// This function sends the request to conversation server +// to set conversation list change observer flag. +// ---------------------------------------------------------------------------- +void RCsSession::SetConversationListChangeObserverL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::ResetConversationListChangeObserverL +// This function sends the request to conversation server +// to reset conversation list change observer flag. +// ---------------------------------------------------------------------------- +void RCsSession::ResetConversationListChangeObserverL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::SetConversationChangeObserverL +// This function sends the request to conversation server +// to set conversation change observer flag for given +// client conversation +// ---------------------------------------------------------------------------- +void RCsSession::SetConversationChangeObserverL( + const TDes8& /*aClientConversation*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::ResetConversationChangeObserverL +// This function sends the request to conversation server +// to reset conversation change observer flag for given +// client conversation +// ---------------------------------------------------------------------------- +void RCsSession::ResetConversationChangeObserverL( + const TDes8& /*aClientConversation*/) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::SetCachingStatusObserverL +// This function sends the request to conversation server +// to set caching status observer flag. +// ---------------------------------------------------------------------------- +void RCsSession::SetCachingStatusObserverL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::ResetConversationListChangeObserverL +// This function sends the request to conversation server +// to reset caching status observer flag. +// ---------------------------------------------------------------------------- +void RCsSession::ResetCachingStatusObserverL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::RequestChangeEventL +// This function sends the request to conversation server +// to register for any cache change event. +// ---------------------------------------------------------------------------- +void RCsSession::RequestChangeEventL(TInt, TPtr8, TPtr8, TRequestStatus&) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::RemoveChangeEventL +// This function sends the request to conversation server +// to deregister for for any cache change event. +// ---------------------------------------------------------------------------- +void RCsSession::RemoveChangeEventL() +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::DeleteConversationL +// ---------------------------------------------------------------------------- +void RCsSession::DeleteConversationL(TInt) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetConversationIdL +// ---------------------------------------------------------------------------- +void RCsSession::GetConversationIdL(TInt, TPtr8) +{ +} + +// ---------------------------------------------------------------------------- +// RCsSession::GetConversationIdFromAddressL +// ---------------------------------------------------------------------------- +void RCsSession::GetConversationIdFromAddressL(TDesC& , TPtr8 ) +{ +} +// ---------------------------------------------------------------------------- +// RCsSession::MarkConversationReadL +// ---------------------------------------------------------------------------- +void RCsSession::MarkConversationReadL(TInt) +{ +} + +// End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,102 @@ +# +# 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: +# +QT += testlib +CONFIG += hb +CONFIG += symbian_test + +TEMPLATE = lib +TARGET = testconversationengine +DEPENDPATH += . inc +DEPENDPATH += . src +DEPENDPATH += ../../../appengine/inc +DEPENDPATH += ../../../appengine/ + +INCLUDEPATH += . + +INCLUDEPATH += ../../../../../inc +INCLUDEPATH += ../../../appengine/inc +INCLUDEPATH += ../../../../msgappfw/client/inc +INCLUDEPATH += ../../../../msgutils/s60qconversions/inc +INCLUDEPATH += ../../../../smartmessaging/ringbc/inc +INCLUDEPATH += /ext/mw/qtextensions/qtmobileextensions/include +INCLUDEPATH += ../../../../msgutils/unieditorutils/editorgenutils/inc +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + +DEFINES += BUILD_TEST_DLL +DEFINES += BUILD_DLL + +HEADERS += \ + testconversationengine.h \ + testconversationenginestub.h \ + testconversationnotifier.h \ + testconversationupdatehandler.h \ + conversationsengine.h \ + conversationmsgstorehandler.h \ + conversationsengine_p.h \ + conversationssummarymodel.h \ + conversationsmodel.h \ + conversationsengineutility.h \ + conversationchangehandler.h \ + conversationlistchangehandler.h \ + draftsmodel.h + +SOURCES += \ + testconversationengine.cpp \ + testccsrequesthandler.cpp \ + testrcssession.cpp \ + testconversationenginestub.cpp \ + testconversationnotifier.cpp \ + testconversationupdatehandler.cpp \ + src/conversationsengine.cpp \ + src/conversationmsgstorehandler.cpp \ + src/conversationsengine_p.cpp \ + src/conversationssummarymodel.cpp \ + src/conversationsmodel.cpp \ + src/conversationsengineutility.cpp \ + src/conversationchangehandler.cpp \ + src/conversationlistchangehandler.cpp \ + src/draftsmodel.cpp + +SYMBIAN_PLATFORMS = WINSCW ARMV5 +symbian { + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.EPOCSTACKSIZE = 0x8000 + TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 + TARGET.EPOCALLOWDLLDATA = 1 + } + +LIBS += -euser \ + -ecom \ + -lcsutils \ + -ls60qconversions \ + -lconvergedmessageutils \ + -lmsgs \ + -lInetProtUtil \ + -lsmildtd \ + -lxmldom \ + -lxmlparser \ + -lunidatamodelloader \ + -leditorgenutils \ + -lsmcm \ + -lQtVersit \ + -lQtContacts \ + -lxqutils \ + -lmmscli \ + -lcommonengine \ + -lmmsserversettings \ + -lFeatMgr \ + -lringbc diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/bwins/appengineu.def --- a/messagingapp/msgui/bwins/appengineu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/bwins/appengineu.def Fri May 14 15:49:35 2010 +0300 @@ -32,9 +32,10 @@ ?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 31 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void) ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 32 NONAME ; bool ConversationsEngine::getConversations(long long) ?clearConversations@ConversationsEngine@@QAE_NXZ @ 33 NONAME ; bool ConversationsEngine::clearConversations(void) - ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 34 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) - ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 35 NONAME ; void ConversationsEngine::deleteMessages(class QList &) + ?getDBHandle@ConversationsEngine@@QAEAAVRSqlDatabase@@AAH@Z @ 34 NONAME ; class RSqlDatabase & ConversationsEngine::getDBHandle(int &) + ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 35 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject - ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 37 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) - ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 38 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 37 NONAME ; void ConversationsEngine::deleteMessages(class QList &) + ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 38 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) + ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/bwins/conversationviewu.def --- a/messagingapp/msgui/bwins/conversationviewu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/bwins/conversationviewu.def Fri May 14 15:49:35 2010 +0300 @@ -10,16 +10,19 @@ ??0MsgConversationBaseView@@QAE@PAVQGraphicsItem@@@Z @ 9 NONAME ; MsgConversationBaseView::MsgConversationBaseView(class QGraphicsItem *) ?handleOk@MsgConversationBaseView@@AAEXABVQVariant@@@Z @ 10 NONAME ; void MsgConversationBaseView::handleOk(class QVariant const &) ?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *) - ?doDelayedConstruction@MsgConversationBaseView@@AAEXXZ @ 12 NONAME ; void MsgConversationBaseView::doDelayedConstruction(void) - ?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 13 NONAME ; void MsgConversationBaseView::openConversation(long long) - ?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 14 NONAME ; void MsgConversationBaseView::conversationViewClosed(void) - ?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject - ?initView@MsgConversationBaseView@@AAEXXZ @ 16 NONAME ; void MsgConversationBaseView::initView(void) - ?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 17 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void) - ?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *) - ?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void) - ?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *) - ??1MsgConversationBaseView@@UAE@XZ @ 21 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void) - ??_EMsgConversationBaseView@@UAE@I@Z @ 22 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int) - ?clearContent@MsgConversationBaseView@@QAEXXZ @ 23 NONAME ; void MsgConversationBaseView::clearContent(void) + ?setPSCVId@MsgConversationBaseView@@QAEX_N@Z @ 12 NONAME ; void MsgConversationBaseView::setPSCVId(bool) + ?doDelayedConstruction@MsgConversationBaseView@@AAEXXZ @ 13 NONAME ; void MsgConversationBaseView::doDelayedConstruction(void) + ?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 14 NONAME ; void MsgConversationBaseView::openConversation(long long) + ?conversationId@MsgConversationBaseView@@QAE_JXZ @ 15 NONAME ; long long MsgConversationBaseView::conversationId(void) + ?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 16 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject + ?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 17 NONAME ; void MsgConversationBaseView::conversationViewClosed(void) + ?initView@MsgConversationBaseView@@AAEXXZ @ 18 NONAME ; void MsgConversationBaseView::initView(void) + ?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 19 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void) + ?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *) + ?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void) + ??1MsgConversationBaseView@@UAE@XZ @ 23 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void) + ?handleViewReady@MsgConversationBaseView@@AAEXXZ @ 24 NONAME ; void MsgConversationBaseView::handleViewReady(void) + ??_EMsgConversationBaseView@@UAE@I@Z @ 25 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int) + ?clearContent@MsgConversationBaseView@@QAEXXZ @ 26 NONAME ; void MsgConversationBaseView::clearContent(void) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/bwins/msguiutilsu.def --- a/messagingapp/msgui/bwins/msguiutilsu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/bwins/msguiutilsu.def Fri May 14 15:49:35 2010 +0300 @@ -1,33 +1,43 @@ EXPORTS ?checkEmailOverSms@MsgSendUtil@@AAE_NAAVConvergedMessage@@AA_N@Z @ 1 NONAME ; bool MsgSendUtil::checkEmailOverSms(class ConvergedMessage &, bool &) - ?getMmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 2 NONAME ; int MsgSendUtil::getMmsMsgSize(class ConvergedMessage &) - ?checkModeForInsert@MmsConformanceCheck@@QAEHABVQString@@_N@Z @ 3 NONAME ; int MmsConformanceCheck::checkModeForInsert(class QString const &, bool) - ?mediaDurationL@MsgMediaUtil@@AAEHABVTDesC16@@@Z @ 4 NONAME ; int MsgMediaUtil::mediaDurationL(class TDesC16 const &) - ??0MsgMediaUtil@@QAE@XZ @ 5 NONAME ; MsgMediaUtil::MsgMediaUtil(void) + ??1MmsConformanceCheck@@UAE@XZ @ 2 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(void) + ?mediaDurationL@MsgMediaUtil@@AAEHABVTDesC16@@@Z @ 3 NONAME ; int MsgMediaUtil::mediaDurationL(class TDesC16 const &) + ??0MsgMediaUtil@@QAE@XZ @ 4 NONAME ; MsgMediaUtil::MsgMediaUtil(void) + ?trUtf8@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString MmsConformanceCheck::trUtf8(char const *, char const *) ?qt_metacast@MsgSendUtil@@UAEPAXPBD@Z @ 6 NONAME ; void * MsgSendUtil::qt_metacast(char const *) ?validateService@MsgSendUtil@@AAE_NPAVUniEditorPluginInterface@@_N@Z @ 7 NONAME ; bool MsgSendUtil::validateService(class UniEditorPluginInterface *, bool) ?showPopup@MmsConformanceCheck@@AAEXABVQString@@@Z @ 8 NONAME ; void MmsConformanceCheck::showPopup(class QString const &) - ?launchEditorQuery@MmsConformanceCheck@@AAE_NXZ @ 9 NONAME ; bool MmsConformanceCheck::launchEditorQuery(void) - ??1MmsConformanceCheck@@QAE@XZ @ 10 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(void) - ??0MsgSendUtil@@QAE@PAVQObject@@@Z @ 11 NONAME ; MsgSendUtil::MsgSendUtil(class QObject *) - ?metaObject@MsgSendUtil@@UBEPBUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const * MsgSendUtil::metaObject(void) const - ?longestEmailAddressSize@MsgSendUtil@@AAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 13 NONAME ; int MsgSendUtil::longestEmailAddressSize(class QList) - ??_EMsgSendUtil@@UAE@I@Z @ 14 NONAME ; MsgSendUtil::~MsgSendUtil(unsigned int) - ?staticMetaObject@MsgSendUtil@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgSendUtil::staticMetaObject - ??0MmsConformanceCheck@@QAE@XZ @ 16 NONAME ; MmsConformanceCheck::MmsConformanceCheck(void) - ?tr@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString MsgSendUtil::tr(char const *, char const *) - ?saveToDrafts@MsgSendUtil@@QAEJAAVConvergedMessage@@@Z @ 18 NONAME ; long MsgSendUtil::saveToDrafts(class ConvergedMessage &) - ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *) - ?getStaticMetaObject@MsgSendUtil@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & MsgSendUtil::getStaticMetaObject(void) - ?getSmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 21 NONAME ; int MsgSendUtil::getSmsMsgSize(class ConvergedMessage &) - ?tr@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString MsgSendUtil::tr(char const *, char const *, int) - ?mediaDuration@MsgMediaUtil@@QAE?AVQString@@ABV2@@Z @ 23 NONAME ; class QString MsgMediaUtil::mediaDuration(class QString const &) - ?validateMsgForForward@MmsConformanceCheck@@QAE_NH@Z @ 24 NONAME ; bool MmsConformanceCheck::validateMsgForForward(int) - ?checkMaxMsgSizeLimit@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 25 NONAME ; bool MsgSendUtil::checkMaxMsgSizeLimit(class ConvergedMessage &) - ??1MsgSendUtil@@UAE@XZ @ 26 NONAME ; MsgSendUtil::~MsgSendUtil(void) - ?qt_metacall@MsgSendUtil@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int MsgSendUtil::qt_metacall(enum QMetaObject::Call, int, void * *) - ??1MsgMediaUtil@@QAE@XZ @ 28 NONAME ; MsgMediaUtil::~MsgMediaUtil(void) - ?send@MsgSendUtil@@QAEHAAVConvergedMessage@@@Z @ 29 NONAME ; int MsgSendUtil::send(class ConvergedMessage &) - ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *, int) - ?checkMaxRecipientCount@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 31 NONAME ; bool MsgSendUtil::checkMaxRecipientCount(class ConvergedMessage &) + ??0MsgSendUtil@@QAE@PAVQObject@@@Z @ 9 NONAME ; MsgSendUtil::MsgSendUtil(class QObject *) + ?metaObject@MsgSendUtil@@UBEPBUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const * MsgSendUtil::metaObject(void) const + ?longestEmailAddressSize@MsgSendUtil@@AAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 11 NONAME ; int MsgSendUtil::longestEmailAddressSize(class QList) + ?getStaticMetaObject@MmsConformanceCheck@@SAABUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const & MmsConformanceCheck::getStaticMetaObject(void) + ??_EMsgSendUtil@@UAE@I@Z @ 13 NONAME ; MsgSendUtil::~MsgSendUtil(unsigned int) + ?staticMetaObject@MsgSendUtil@@2UQMetaObject@@B @ 14 NONAME ; struct QMetaObject const MsgSendUtil::staticMetaObject + ??0MmsConformanceCheck@@QAE@XZ @ 15 NONAME ; MmsConformanceCheck::MmsConformanceCheck(void) + ?metaObject@MmsConformanceCheck@@UBEPBUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const * MmsConformanceCheck::metaObject(void) const + ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *) + ?getStaticMetaObject@MsgSendUtil@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & MsgSendUtil::getStaticMetaObject(void) + ?qt_metacall@MmsConformanceCheck@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 19 NONAME ; int MmsConformanceCheck::qt_metacall(enum QMetaObject::Call, int, void * *) + ?getSmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 20 NONAME ; int MsgSendUtil::getSmsMsgSize(class ConvergedMessage &) + ?tr@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString MsgSendUtil::tr(char const *, char const *, int) + ?validateMsgForForward@MmsConformanceCheck@@QAE_NH@Z @ 22 NONAME ; bool MmsConformanceCheck::validateMsgForForward(int) + ?checkMaxMsgSizeLimit@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 23 NONAME ; bool MsgSendUtil::checkMaxMsgSizeLimit(class ConvergedMessage &) + ?trUtf8@MmsConformanceCheck@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString MmsConformanceCheck::trUtf8(char const *, char const *, int) + ?tr@MmsConformanceCheck@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString MmsConformanceCheck::tr(char const *, char const *, int) + ??1MsgMediaUtil@@QAE@XZ @ 26 NONAME ; MsgMediaUtil::~MsgMediaUtil(void) + ?send@MsgSendUtil@@QAEHAAVConvergedMessage@@@Z @ 27 NONAME ; int MsgSendUtil::send(class ConvergedMessage &) + ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 28 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *, int) + ?checkMaxRecipientCount@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 29 NONAME ; bool MsgSendUtil::checkMaxRecipientCount(class ConvergedMessage &) + ?getMmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 30 NONAME ; int MsgSendUtil::getMmsMsgSize(class ConvergedMessage &) + ?onDialogInsertMedia@MmsConformanceCheck@@AAEXPAVHbAction@@@Z @ 31 NONAME ; void MmsConformanceCheck::onDialogInsertMedia(class HbAction *) + ?checkModeForInsert@MmsConformanceCheck@@QAEHABVQString@@_N@Z @ 32 NONAME ; int MmsConformanceCheck::checkModeForInsert(class QString const &, bool) + ?qt_metacast@MmsConformanceCheck@@UAEPAXPBD@Z @ 33 NONAME ; void * MmsConformanceCheck::qt_metacast(char const *) + ?tr@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 34 NONAME ; class QString MmsConformanceCheck::tr(char const *, char const *) + ?staticMetaObject@MmsConformanceCheck@@2UQMetaObject@@B @ 35 NONAME ; struct QMetaObject const MmsConformanceCheck::staticMetaObject + ?saveToDrafts@MsgSendUtil@@QAEJAAVConvergedMessage@@@Z @ 36 NONAME ; long MsgSendUtil::saveToDrafts(class ConvergedMessage &) + ?tr@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 37 NONAME ; class QString MsgSendUtil::tr(char const *, char const *) + ?mediaDuration@MsgMediaUtil@@QAE?AVQString@@ABV2@@Z @ 38 NONAME ; class QString MsgMediaUtil::mediaDuration(class QString const &) + ??_EMmsConformanceCheck@@UAE@I@Z @ 39 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(unsigned int) + ??1MsgSendUtil@@UAE@XZ @ 40 NONAME ; MsgSendUtil::~MsgSendUtil(void) + ?qt_metacall@MsgSendUtil@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int MsgSendUtil::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/bwins/unifiededitoru.def --- a/messagingapp/msgui/bwins/unifiededitoru.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/bwins/unifiededitoru.def Fri May 14 15:49:35 2010 +0300 @@ -6,47 +6,59 @@ ?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 5 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool) ?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 6 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *) ?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 7 NONAME ; void MsgUnifiedEditorView::fetchImages(void) - ?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 8 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *) - ?sendingOptions@MsgUnifiedEditorView@@AAEXXZ @ 9 NONAME ; void MsgUnifiedEditorView::sendingOptions(void) - ?saveContentToDrafts@MsgUnifiedEditorView@@QAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::saveContentToDrafts(void) - ?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 11 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &) - ?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject - ?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 13 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void) - ?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 14 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *) - ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 15 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int) - ?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 16 NONAME ; void MsgUnifiedEditorView::populateContent(class QList const &) - ?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 17 NONAME ; void MsgUnifiedEditorView::addCcBcc(void) - ?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 18 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int) - ?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 19 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &) - ?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const - ?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 21 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &) - ?audiosFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 22 NONAME ; void MsgUnifiedEditorView::audiosFetched(class QVariant const &) - ?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 23 NONAME ; void MsgUnifiedEditorView::addSubject(void) - ?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 24 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &) - ?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 25 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &) - ?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 26 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *) - ?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 27 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int) - ?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 28 NONAME ; void MsgUnifiedEditorView::addMenu(void) - ??_EMsgUnifiedEditorView@@UAE@I@Z @ 29 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int) - ??1MsgUnifiedEditorView@@UAE@XZ @ 30 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void) - ?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@@Z @ 31 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &) - ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *) - ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *) - ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 34 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int) - ?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 35 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void) - ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 36 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int) - ?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@@Z @ 37 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &) - ?send@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::send(void) - ?Reset@CUniImageProcessor@@QAEXXZ @ 39 NONAME ; void CUniImageProcessor::Reset(void) - ?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 40 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList const &) - ?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 41 NONAME ; void MsgUnifiedEditorView::addToolBar(void) - ?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 42 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &) - ?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 43 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void) - ?pluginPath@MsgUnifiedEditorView@@AAE?AVQString@@XZ @ 44 NONAME ; class QString MsgUnifiedEditorView::pluginPath(void) - ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int) - ??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 46 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *) - ?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 47 NONAME ; void MsgUnifiedEditorView::fetchContacts(void) - ?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 48 NONAME ; void MsgUnifiedEditorView::deleteMessage(void) - ?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 49 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList) - ?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 50 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void) + ?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@_N@Z @ 8 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool) + ?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 9 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *) + ?sendingOptions@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::sendingOptions(void) + ?saveContentToDrafts@MsgUnifiedEditorView@@QAEXXZ @ 11 NONAME ; void MsgUnifiedEditorView::saveContentToDrafts(void) + ?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 12 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &) + ?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 13 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void) + ?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 14 NONAME ; void MsgUnifiedEditorView::onContentChanged(void) + ?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject + ?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 16 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void) + ?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 17 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *) + ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 18 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int) + ?onDialogSmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 19 NONAME ; void MsgUnifiedEditorView::onDialogSmsSettings(class HbAction *) + ?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 20 NONAME ; void MsgUnifiedEditorView::populateContent(class QList const &) + ?onDialogMmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 21 NONAME ; void MsgUnifiedEditorView::onDialogMmsSettings(class HbAction *) + ?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 22 NONAME ; void MsgUnifiedEditorView::addCcBcc(void) + ?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 23 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int) + ?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 24 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &) + ?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const + ?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 26 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &) + ?audiosFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 27 NONAME ; void MsgUnifiedEditorView::audiosFetched(class QVariant const &) + ?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 28 NONAME ; void MsgUnifiedEditorView::addSubject(void) + ?createTempFolder@MsgUnifiedEditorView@@AAE_NXZ @ 29 NONAME ; bool MsgUnifiedEditorView::createTempFolder(void) + ?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 30 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &) + ?setFocus@MsgUnifiedEditorView@@AAEXPAVMsgUnifiedEditorBaseWidget@@@Z @ 31 NONAME ; void MsgUnifiedEditorView::setFocus(class MsgUnifiedEditorBaseWidget *) + ?vkbClosed@MsgUnifiedEditorView@@AAEXXZ @ 32 NONAME ; void MsgUnifiedEditorView::vkbClosed(void) + ?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 33 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &) + ?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 34 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *) + ?removeTempFolder@MsgUnifiedEditorView@@AAEXXZ @ 35 NONAME ; void MsgUnifiedEditorView::removeTempFolder(void) + ?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 36 NONAME ; void MsgUnifiedEditorView::vkbOpened(void) + ?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 37 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int) + ?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::addMenu(void) + ?initView@MsgUnifiedEditorView@@AAEXXZ @ 39 NONAME ; void MsgUnifiedEditorView::initView(void) + ??_EMsgUnifiedEditorView@@UAE@I@Z @ 40 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int) + ??1MsgUnifiedEditorView@@UAE@XZ @ 41 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void) + ?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 42 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool) + ?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 43 NONAME ; void MsgUnifiedEditorView::hideChrome(bool) + ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *) + ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *) + ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 46 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int) + ?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void) + ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int) + ?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@@Z @ 49 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &) + ?send@MsgUnifiedEditorView@@AAEXXZ @ 50 NONAME ; void MsgUnifiedEditorView::send(void) + ?Reset@CUniImageProcessor@@QAEXXZ @ 51 NONAME ; void CUniImageProcessor::Reset(void) + ?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 52 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList const &) + ?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 53 NONAME ; void MsgUnifiedEditorView::addToolBar(void) + ?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 54 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &) + ?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 55 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void) + ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 56 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int) + ?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 57 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *) + ??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 58 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *) + ?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 59 NONAME ; void MsgUnifiedEditorView::fetchContacts(void) + ?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 60 NONAME ; void MsgUnifiedEditorView::deleteMessage(void) + ?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 61 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList) + ?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 62 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/bwins/unifiedvieweru.def --- a/messagingapp/msgui/bwins/unifiedvieweru.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/bwins/unifiedvieweru.def Fri May 14 15:49:35 2010 +0300 @@ -3,15 +3,15 @@ ?populateContent@UnifiedViewer@@QAEXH_NH@Z @ 2 NONAME ; void UnifiedViewer::populateContent(int, bool, int) ?handleDeleteAction@UnifiedViewer@@QAEXXZ @ 3 NONAME ; void UnifiedViewer::handleDeleteAction(void) ?metaObject@UnifiedViewer@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * UnifiedViewer::metaObject(void) const - ?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 5 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *) - ??0UnifiedViewer@@QAE@HPAVQGraphicsItem@@@Z @ 6 NONAME ; UnifiedViewer::UnifiedViewer(int, class QGraphicsItem *) - ?handleFwdAction@UnifiedViewer@@QAEXXZ @ 7 NONAME ; void UnifiedViewer::handleFwdAction(void) - ?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 8 NONAME ; void * UnifiedViewer::qt_metacast(char const *) - ?createToolBar@UnifiedViewer@@AAEXXZ @ 9 NONAME ; void UnifiedViewer::createToolBar(void) - ??1UnifiedViewer@@UAE@XZ @ 10 NONAME ; UnifiedViewer::~UnifiedViewer(void) - ??_EUnifiedViewer@@UAE@I@Z @ 11 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int) - ?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *) - ?sendMessage@UnifiedViewer@@AAEXABVQString@@@Z @ 13 NONAME ; void UnifiedViewer::sendMessage(class QString const &) + ?sendMessage@UnifiedViewer@@AAEXABVQString@@0@Z @ 5 NONAME ; void UnifiedViewer::sendMessage(class QString const &, class QString const &) + ?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 6 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *) + ??0UnifiedViewer@@QAE@HPAVQGraphicsItem@@@Z @ 7 NONAME ; UnifiedViewer::UnifiedViewer(int, class QGraphicsItem *) + ?handleFwdAction@UnifiedViewer@@QAEXXZ @ 8 NONAME ; void UnifiedViewer::handleFwdAction(void) + ?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 9 NONAME ; void * UnifiedViewer::qt_metacast(char const *) + ?createToolBar@UnifiedViewer@@AAEXXZ @ 10 NONAME ; void UnifiedViewer::createToolBar(void) + ??1UnifiedViewer@@UAE@XZ @ 11 NONAME ; UnifiedViewer::~UnifiedViewer(void) + ??_EUnifiedViewer@@UAE@I@Z @ 12 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int) + ?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *) ?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString UnifiedViewer::tr(char const *, char const *) ?validateMsgForForward@UnifiedViewer@@AAE_NXZ @ 15 NONAME ; bool UnifiedViewer::validateMsgForForward(void) ?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void) @@ -19,4 +19,5 @@ ?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int) ?clearContent@UnifiedViewer@@QAEXXZ @ 19 NONAME ; void UnifiedViewer::clearContent(void) ?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int) + ?onDialogDeleteMsg@UnifiedViewer@@AAEXPAVHbAction@@@Z @ 21 NONAME ; void UnifiedViewer::onDialogDeleteMsg(class HbAction *) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/conversationview.pro --- a/messagingapp/msgui/conversationview/conversationview.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/conversationview.pro Fri May 14 15:49:35 2010 +0300 @@ -29,6 +29,7 @@ INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc INCLUDEPATH += ../appengine/inc INCLUDEPATH += ../../smartmessaging/ringbc/inc +INCLUDEPATH += ../../msgsettings/settingsview/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE INCLUDEPATH += /ext/mw/qthighway/inc @@ -54,8 +55,6 @@ HEADERS += inc/msgconversationview.h \ inc/msgconversationviewitem.h \ inc/msgconversationwidget.h \ - inc/msgcharcounter_p.h \ - inc/msgcharcounter.h \ inc/msgviewutils.h \ ../../../inc/msgconversationviewdefines.h \ inc/msgcontactcardwidget.h \ @@ -67,8 +66,6 @@ SOURCES += src/msgconversationview.cpp \ src/msgconversationviewitem.cpp \ src/msgconversationwidget.cpp \ - src/msgcharcounter_p.cpp \ - src/msgcharcounter.cpp \ src/msgviewutils.cpp \ src/msgcontactcardwidget.cpp \ src/msgeditorwidget.cpp \ @@ -97,5 +94,10 @@ -lunieditorpluginloader \ -lgsmu \ -lsmcm \ - -leditorgenutils + -leditorgenutils \ + -lthumbnailmanagerqt \ + -lfbscli \ + -lestor \ + -lsqldb \ + -lxqsettingsmanager diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/conversationview.qrc --- a/messagingapp/msgui/conversationview/conversationview.qrc Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/conversationview.qrc Fri May 14 15:49:35 2010 +0300 @@ -2,4 +2,16 @@ resources/qtg_anim_loading.axml + + resources/layouts/msgcontactcardwidget.css + resources/layouts/msgcontactcardwidget.widgetml + resources/layouts/msgconversationviewitem.css + resources/layouts/msgconversationviewitem.widgetml + resources/layouts/msgconversationwidget.css + resources/layouts/msgconversationwidget.widgetml + resources/layouts/msgconversationwidget_color.css + resources/layouts/msgeditorwidget.css + resources/layouts/msgeditorwidget.widgetml + resources/layouts/msgcontactcardwidget_color.css + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgcharcounter.h --- a/messagingapp/msgui/conversationview/inc/msgcharcounter.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +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:Implements QT functionality to get message pdu details. - * - */ - -#ifndef MSGCHARCOUNTER_H -#define MSGCHARCOUNTER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MsgCharCounterPrivate; - -// CLASS DECLARATION - -/** - * MsgCharCounter - * - * This class is a QT public class which provides methods to set encoding - * settings and get the PDU info. - */ -class MsgCharCounter : public QObject -{ - Q_OBJECT - -public: - - /** - * Default Constructor. - */ - MsgCharCounter(QObject *parent = 0); - - /** - * Destructor. - */ - ~MsgCharCounter(); - - /** - * To Set encoding settings like encoding type, character support and - * alternative encoding if any. - */ - void setEncodingSettings(); - - /** - * Gets the PDU info like, number of PDUs, number of remaining chars in last - * PDU and encoding types used. - * @param buf PDU buffer as input. - * @param numOfRemainingChars output - * @param numOfPDUs output - * @param unicodeMode output - * @param alternativeEncodingType output - */ - void getNumPDUs(const QString &buf, int &numOfRemainingChars, - int &numOfPDUs, bool &unicodeMode, - int &alternativeEncodingType); - -private: - - /** - * Pointer to S60 class MsgFetcherPrivate. - * Own. - */ - MsgCharCounterPrivate *d_ptr; -}; - -#endif /* MSGCHARCOUNTER_H */ - -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgcharcounter_p.h --- a/messagingapp/msgui/conversationview/inc/msgcharcounter_p.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +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:Implements Symbian functionality to get message pdu details. - * - */ - -#ifndef MSGCHARCOUNTER_P_H -#define MSGCHARCOUNTER_P_H - -// INCLUDES -#include -#include -#include - -// FORWARD DECLARATIONS -class MsgCharCounter; -class CParaFormatLayer; -class CCharFormatLayer; -class CRichText; -class CSmsHeader; -class QString; - -// CLASS DECLARATION - -/** - * MsgCharCounterPrivate - * - * This class is a Symbian private class which provides methods to set encoding - * settings and get the PDU info. - */ -class MsgCharCounterPrivate -{ -public: - - /** - * Two-phased constructor. - * @param msgCharCounter Ptr to MsgCharCounter. - */ - static MsgCharCounterPrivate* newL(MsgCharCounter* msgCharCounter); - - /** - * Destructor. - */ - ~MsgCharCounterPrivate(); - - /** - * To Set encoding settings like encoding type, character support and - * alternative encoding if any. - * @param unicodeMode True if unicode. - * @param alternativeEncodingType Alternative 7bit encoding combinations. - * @param charSupportType Character support type, full or reduced. - */ - void setEncodingSettings(bool unicodeMode, int alternativeEncodingType, - int charSupportType); - - /** - * Gets the PDU info like, number of PDUs, number of remaining chars in last - * PDU and encoding types used. - * @param buf PDU buffer as input. - * @param numOfRemainingChars output - * @param numOfPDUs output - * @param unicodeMode output - * @param alternativeEncodingType output - */ - void getNumPDUs(const QString &buf, int &numOfRemainingChars, - int &numOfPDUs, bool &unicodeMode, int &alternativeEncodingType); - -private: - - /** - * Constructor for performing 1st stage construction - * @param . - */ - MsgCharCounterPrivate(MsgCharCounter *msgCharCounter); - - /** - * EPOC default constructor for performing 2nd stage construction - */ - void constructL(); - -private: - // Data - - /** - * Ptr to QT class MsgCharCounter. - * Not Own. - */ - MsgCharCounter *q_ptr; - - /** - * Paragraph format layer. - * Own. - */ - CParaFormatLayer* mParaFormatLayer; - - /** - * Character format layer. - * Own. - */ - CCharFormatLayer* mCharFormatLayer; - - /** - * Text with rich formatting. - * Own. - */ - CRichText* mRichText; - - /** - * SMS MTM encapsulation of an SMS message. - * Own. - */ - CSmsHeader* mSmsHeader; - - /** - * True if message is converted to unicode. - */ - TBool mUnicodeMode; - - /** - * Character support, full or reduced. - */ - TInt mCharSupportType; - - /** - * GSM encoding type. - */ - TSmsEncoding mAlternativeEncodingType; - -}; - -#endif // MSGCHARCOUNTER_P_H - -//EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h --- a/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h Fri May 14 15:49:35 2010 +0300 @@ -26,14 +26,15 @@ class HbTextItem; class HbIcon; class QGraphicsSceneMouseEvent; -class HbGestureSceneFilter; +//class HbGestureSceneFilter; +class ThumbnailManager; #include "convergedmessageaddress.h" /** * This class is a custom layout widget for Contact Card layout. */ -class MsgContactCardWidget : public HbWidget +class MsgContactCardWidget: public HbWidget { Q_OBJECT @@ -78,29 +79,29 @@ * Refreshes all the Contact card fields. */ void updateContents(); - /** * Clears all the Contact card fields. */ void clearContent(); - + /** * for tactile feed back. + * Depricated */ - HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; - + // HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; + /** * To connect/disconnect clicked signal */ void connectSignals(bool yes); - + protected: /** * reimplemented from base class. */ virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - + /** * reimplemented from base class. */ @@ -117,65 +118,69 @@ * @param value phone number. */ int resolveContactId(const QString& value); - + /** * Helper method to set back ground. */ void setBackGround(const QString& bg); - + private slots: /** * show longpress menu for attachment object */ void handleLongPress(QPointF position); - + /** * Helper method to initialize gesture. */ void initGesture(); - + /** * Slot for handling valid returns from the framework. * Updates the display name in the contact card widget. * @param result const QVariant& */ void handleOk(const QVariant& result); - + /** * Slot for handling errors. Error ids are provided as * 32-bit integers. * @param errorCode qint32 */ void handleError(int errorCode, const QString& errorMessage); - + /** * Called when clicked() signal is emitted * Launches phonebook to view an existing contact * or to add a new contact */ void openContactInfo(); - + /** * Launches Dialer Service */ void call(); - + /** * Adds unknown number to phonebook */ void addToContacts(); - + /** * Called after service request is completed. */ void onServiceRequestCompleted(); + /** + * Slot hit when the thumbnail is ready. + */ + void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); + signals: - /** - * Emitted when contact card is short tapped. - */ + /** + * Emitted when contact card is short tapped. + */ void clicked(); - private: // Data @@ -184,13 +189,13 @@ /** * To supress short tap if long tap triggered. */ - bool mMenuShown; - - /** + bool mMenuShown; + + /** * Contact Number for the conversation */ QString mContactNumber; - + /** * Address string. */ @@ -213,15 +218,17 @@ * Own. */ HbTextItem *mAddressTextItem; - + /** * gesture filter for long press. - */ - HbGestureSceneFilter* mGestureFilter; - + */ + // HbGestureSceneFilter* mGestureFilter; - - + /** + * ThumbnailManager + * Own. + */ + ThumbnailManager *mThumbnailManager; }; #endif // MSGCONTACTCARDWIDGET_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgconversationbaseview.h --- a/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h Fri May 14 15:49:35 2010 +0300 @@ -25,6 +25,7 @@ #define CONVERSATION_VIEW_EXPORT Q_DECL_IMPORT #endif +#include #include "msgbaseview.h" // FORWARD DECLARATIONS @@ -32,6 +33,8 @@ class HbListWidgetItem; class MsgContactCardWidget; class QGraphicsLinearLayout; +class XQSettingsManager; +class XQPublishAndSubscribeUtils; class CONVERSATION_VIEW_EXPORT MsgConversationBaseView : public MsgBaseView { @@ -69,6 +72,12 @@ * Saves the editors content in cv to drafts */ void saveContentToDrafts(); + + /** + * conversationId + * Get the conversationId + */ + qint64 conversationId(); public slots: /** @@ -82,6 +91,13 @@ * Slot is triiggered when replying started */ void markMessagesAsRead(); + + /** + * Publish the conversation id based on the flag. + * @param setId if true previous conversation id + * will be published else -1 will be published. + */ + void setPSCVId(bool setId); private slots: /** @@ -107,8 +123,12 @@ * @param errorCode qint32 */ void handleError(int errorCode, const QString& errorMessage); + + /** + * Slot for handling the timer expiry event fired from view reay indication + */ + void handleViewReady(); - signals: /** * Signal emitted when the conversation view is closed. @@ -143,7 +163,19 @@ * Main layout. */ QGraphicsLinearLayout* mMainLayout; + + /** + * Object of XQSettingsKey. + */ + XQSettingsKey mCVIdkey; + /** + * mSettingsManager + * Instance of the XQSettingsManager + * Own. + */ + XQSettingsManager* mSettingsManager; + }; #endif // MSG_CONVERSATION_VIEW_INTERFACE_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgconversationview.h --- a/messagingapp/msgui/conversationview/inc/msgconversationview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgconversationview.h Fri May 14 15:49:35 2010 +0300 @@ -32,7 +32,7 @@ class MsgConversationViewItem; class HbStaticVkbHost; class QGraphicsLinearLayout; - +class HbAction; //Defines #define INVALID_MSG_ID -1 @@ -77,6 +77,30 @@ * Populates the menu with relevant actions. */ void menuAboutToShow(); + + /** + * This slot is called when settings dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogSettingsLaunch(HbAction* action); + + /** + * This slot is called when delete message centre dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogdeleteMsg(HbAction* action); + + /** + * This slot is called when download message centre dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDownLoadMsg(HbAction* action); + + /** + * This slot is called when save tone dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogSaveTone(HbAction* action); private: @@ -106,6 +130,15 @@ void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); /** + * Adds context menu entry to context menu for saving items + * @param MsgConversationViewItem* item whose information is needed. + * @param HbMenu context menu + * @param int sendingstate. + * @see ConvergedMessage::MessageType + */ + void addSaveItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState); + + /** * Adds context menu entry to context menu for Opening items * @param MsgConversationViewItem* item whose information is needed. * @param HbMenu context menu @@ -336,6 +369,12 @@ * Deactivate Input Blocker */ void deactivateInputBlocker(); + + /** + * Handle provisioning message + * @param msgId message id + */ + void handleProvisoningMsg(int msgId); private: @@ -373,6 +412,7 @@ /** * Flag to track if item has been long pressed. + * TODO: Remove it, once unique longpress and click event signal released in week16 */ bool mItemLongPressed; /* diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgconversationviewitem.h --- a/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h Fri May 14 15:49:35 2010 +0300 @@ -20,6 +20,7 @@ // INCLUDES #include +#include "convergedmessage.h" //Forward Declarations class MsgConversationWidget; @@ -89,6 +90,16 @@ * Set the Icon that displays the message notification state. */ void setNotificationStateIcon(int notificationState); + + /* + * Update item with sms content + */ + void updateSmsTypeItem(const QModelIndex& index,int messageSubType = ConvergedMessage::None); + + /* + * Update item with mms type content + */ + void updateMmsTypeItem(const QModelIndex& index, int messageType,int messageSubType); protected: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgconversationwidget.h --- a/messagingapp/msgui/conversationview/inc/msgconversationwidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgconversationwidget.h Fri May 14 15:49:35 2010 +0300 @@ -30,24 +30,23 @@ * This class represents the custom layouted widget to show * the conversation inside a bubble shape in the conversation view. */ -class MsgConversationWidget : public HbWidget +class MsgConversationWidget: public HbWidget { Q_OBJECT - Q_PROPERTY(int priority READ priority WRITE setPriority) - Q_PROPERTY(bool hasAttachment READ hasAttachment WRITE setAttachment) - Q_PROPERTY(bool hasImage READ hasImage WRITE setImage) - Q_PROPERTY(bool hasAudio READ hasAudio WRITE setAudio) - Q_PROPERTY(bool hasVideo READ hasVideo WRITE setVideo) - Q_PROPERTY(bool isPlayable READ isPlayable WRITE setPlayable) - Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming) - Q_PROPERTY(bool isMMS READ isMMS WRITE setMMS) - Q_PROPERTY(bool isMMSNotification READ isMMSNotification WRITE setMMSNotification) - Q_PROPERTY(bool isUnread READ isUnread WRITE setUnread) - Q_PROPERTY(int sendingState READ sendingState WRITE setSendingState) - Q_PROPERTY(int notificationState READ notificationState WRITE setNotificationState) - - Q_ENUMS(MessageState) +Q_ENUMS(SendingState) +Q_PROPERTY(int priority READ priority WRITE setPriority) +Q_PROPERTY(bool hasAttachment READ hasAttachment WRITE setAttachment) +Q_PROPERTY(bool hasImage READ hasImage WRITE setImage) +Q_PROPERTY(bool hasAudio READ hasAudio WRITE setAudio) +Q_PROPERTY(bool hasVideo READ hasVideo WRITE setVideo) +Q_PROPERTY(bool isPlayable READ isPlayable WRITE setPlayable) +Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming) +Q_PROPERTY(bool isMMS READ isMMS WRITE setMMS) +Q_PROPERTY(bool isMMSNotification READ isMMSNotification WRITE setMMSNotification) +Q_PROPERTY(bool isUnread READ isUnread WRITE setUnread) +Q_PROPERTY(SendingState sendingState READ sendingState WRITE setSendingState) +Q_PROPERTY(int notificationState READ notificationState WRITE setNotificationState) public: @@ -66,6 +65,15 @@ public: /** + * Enum defining Message Sending State + * @attention This enum can have values from 0 to 255 only. + */ + enum SendingState + { + Unknown = 0x00, Sent = 0x01, Sending = 0x02, Pending = 0x03, Failed = 0x04 + }; + + /** * Set subject for this widget * @param QString */ @@ -81,7 +89,7 @@ * Set preview icon path for this widget * @param QString */ - void setPreviewIconPath(const QString &previewPath); + void setPreviewIconPath(const QString& filePath,int msgId); /** * Set priority property @@ -210,7 +218,7 @@ * @return bool */ bool isMMSNotification(); - + /** * Set the sending state. * Maps ConvergedMessage::SendingState to MessageState. @@ -222,7 +230,7 @@ * Returns the sending state. * @return Returns one of the states from enum SendingState. */ - int sendingState(); + SendingState sendingState(); /** * Set the notification state. @@ -236,7 +244,7 @@ * @return Returns one of the states from enum NotificationState. */ int notificationState(); - + /** * Sets the Timestamp. * @param timeStamp Timestamp to be set. @@ -264,6 +272,16 @@ */ void pressStateChanged(bool pressed, bool animate); + /** + * Function to reset widget items. + */ + void resetProperties(); + + /** + * Function to repolish the widget + */ + void repolishWidget(); + private: /** @@ -274,19 +292,6 @@ public: /** - * Enum defining Message Sending State - * @attention This enum can have values from 0 to 255 only. - */ - enum MessageState - { - Unknown = 0x00, - Sent = 0x01, - Sending = 0x02, - Pending = 0x03, - Failed = 0x04 - }; - - /** * Enum defining MMS Notification's Msg State * These are added here so that notification state * can be used inside css in future @@ -294,13 +299,13 @@ * Add any new states only at the bottom of this enum */ enum NotificationState - { + { NotifUnknown = 0x00, NotifReadyForFetching = 0x01, NotifRetrieving = 0x02, NotifExpired = 0x03, - NotifFailed = 0x04, - }; + NotifFailed = 0x04, + }; private: @@ -355,7 +360,7 @@ * Holds info if this widget is MMS Notification */ bool mIsMMSNotification; - + /** * Info about message priority. * @attention Stores high/low/normal priority. @@ -366,13 +371,13 @@ /** * Holds sending state information. */ - int mSendingState; + MsgConversationWidget::SendingState mSendingState; /** * Holds Notification state information. */ int mNotificationState; - + /** * Graphics Item to hold new message icon. * Owned diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/inc/msgeditorwidget.h --- a/messagingapp/msgui/conversationview/inc/msgeditorwidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/inc/msgeditorwidget.h Fri May 14 15:49:35 2010 +0300 @@ -26,6 +26,7 @@ class HbPushButton; class HbFrameItem; class HbTextItem; +class HbAction; class UniEditorPluginLoader; class UniEditorPluginInterface; class UniEditorGenUtils; @@ -100,7 +101,7 @@ /** * This function does initialisations needed for character counter */ - void setEncodingSettings(); + void setEncodingSettingsL(); signals: @@ -150,6 +151,12 @@ */ void onPressed(); void onReleased(); + + /** + * This slot is called when sms char limit reached dialog is launched. + * @param action selected action (yes or no). + */ + void onSmsCharLimitReached(HbAction* action); private: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,46 @@ + +MsgContactCardWidget +{ + layout:layout-msg-mycard; + zvalue:3; +} + +MsgContactCardWidget::avatar +{ + left:-var(hb-param-margin-gene-left); + top:-1.0un; + bottom:1.0un; + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-primary-large); + pref-height:var(hb-param-graphic-size-primary-large); +} + +MsgContactCardWidget::presence +{ + right:var(hb-param-margin-gene-right); + center-vertical:0un; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-secondary); + pref-hieght:var(hb-param-graphic-size-secondary); +} + +MsgContactCardWidget::addressText +{ + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); + center-vertical:0un; + text-height:var(hb-param-text-height-primary); + font-variant:primary; + text-line-count-min:1; + text-line-count-max:1; +} + +MsgContactCardWidget::backgroundFrame +{ + zvalue:-1; + left:0un; + top:0un; + right:0un; + bottom:0un; +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget_color.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,5 @@ + +MsgContactCardWidget::addressText +{ + color:var(qtc_groupbox_normal); +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,50 @@ +MsgConversationViewItem[isIncoming="true"] +{ + layout:layout-incoming; + pref-height:-1; + pref-width:-1; + size-policy-vertical:minimum-expanding; +} + +MsgConversationViewItem[isIncoming="false"] +{ + layout:layout-outgoing; + pref-height:-1; + pref-width:-1; + size-policy-vertical:minimum-expanding; +} + +MsgConversationViewItem[isIncoming="true"]::msgconvwidget +{ + left:-var(hb-param-margin-gene-left); + top:0.0un; + right:var(hb-param-margin-gene-middle-horizontal); + bottom:0.0un; +} + +MsgConversationViewItem[isIncoming="true"]::msgStateIcon +{ + right:var(hb-param-margin-gene-right); + size-policy:fixed fixed; + aspect-ratio:ignore; + pref-height:var(hb-param-graphic-size-primary-small); + pref-width:var(hb-param-graphic-size-primary-small); +} + +MsgConversationViewItem[isIncoming="false"]::msgconvwidget +{ + top:0.0un; + right:var(hb-param-margin-gene-right); + bottom:0.0un; + left:-var(hb-param-margin-gene-middle-horizontal); +} + +MsgConversationViewItem[isIncoming="false"]::msgStateIcon +{ + left:-var(hb-param-margin-gene-left); + size-policy:fixed fixed; + aspect-ratio:ignore; + pref-height:var(hb-param-graphic-size-primary-small); + pref-width:var(hb-param-graphic-size-primary-small); +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,214 @@ + +/*********************************** LAYOUTS **********************************/ + +@variables +{ + bubble_width:expr(var(hb-param-screen-width)-var(hb-param-margin-gene-middle-horizontal)-var(hb-param-graphic-size-primary-small)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); + bubble_height:expr((3*var(bubble_width))/4); +} + +MsgConversationWidget:portrait +{ + layout:layout-mms-portrait; +} + +MsgConversationWidget[hasImage="true"]:landscape +{ + layout:layout-mms-image-landscape; +} + +MsgConversationWidget[hasImage="false"]:landscape +{ + layout:layout-mms-landscape; +} + +MsgConversationWidget[hasImage="false"][hasAudio="true"][hasVideo="false"]:portrait +{ + layout:layout-mms-audio-text-portrait; +} + +MsgConversationWidget[hasImage="false"][hasAudio="true"][hasVideo="false"]:landscape +{ + layout:layout-mms-audio-text-landscape; +} + +/********************* UNREAD INDICATOR / NEW ITEM ICON ************************/ + +MsgConversationWidget::newItemIcon +{ + left:-0.25un; + top:-1.0un; + bottom:1.0un; + size-policy:fixed preferred; + fixed-width:1.25un; +} + +/*********************************** BUBBLE ***********************************/ + +MsgConversationWidget::bubble +{ + left:0.0un; + top:0.0un; + right:0.0un; + bottom:0.0un; + zvalue:-1; +} + +/********************************** BODYTEXT **********************************/ + +MsgConversationWidget::bodyText +{ + left:-var(hb-param-margin-gene-left); + top:-var(hb-param-margin-gene-top); + right:1.0un; + bottom:var(hb-param-margin-gene-middle-vertical); + text-height:var(hb-param-text-height-secondary); + font-variant:primary; + text-align:left; + text-line-count-min:1; + text-line-count-max:100; +} + +MsgConversationWidget[hasImage="true"]::bodyText:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + +MsgConversationWidget[hasImage="false"][hasAudio="true"]::bodyText:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + +/********************************** SUBJECT ***********************************/ + +MsgConversationWidget::subject +{ + left:-var(hb-param-margin-gene-left); + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-middle-vertical); + right:var(hb-param-margin-gene-middle-horizontal); + text-align:left; + text-height:var(hb-param-text-height-primary); + font-variant:primary; + text-line-count-min:1; + text-line-count-max:1; +} + +MsgConversationWidget[isMMS="false"]::subject +{ + text-line-count-max:100; + text-height:var(hb-param-text-height-secondary); +} + +MsgConversationWidget[hasImage="true"]::subject:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + +MsgConversationWidget[hasImage="false"][hasAudio="true"]::subject:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + + +/******************************* ATTACHMENT ICON ******************************/ + +MsgConversationWidget::attachment +{ + right:1.0un; + center-vertical:0.0un; + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-secondary); + pref-height:var(hb-param-graphic-size-secondary); +} + +/********************************* PRIORITY ICON ******************************/ + +MsgConversationWidget::priority +{ + right:0.5un; + center-vertical:0.0un; + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-secondary); + pref-height:var(hb-param-graphic-size-secondary); +} + +/******************************** IMAGE / PREVIEW *****************************/ + +MsgConversationWidget[hasImage="true"]::preview:portrait +{ + left:-var(hb-param-margin-gene-left); + right:1.0un; + bottom:var(hb-param-margin-gene-middle-vertical); + aspect-ratio:keep; + /*max-width:var(bubble_width);*/ + max-width:41.36un; + max-height:31.02un; + /*max-height:var(bubble_height);*/ + min-width:16un; + min-height:12un; +} + +MsgConversationWidget[hasImage="true"]::preview:landscape +{ + left:-var(hb-param-margin-gene-left); + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-bottom); + aspect-ratio:keep; + max-width:41.36un; + max-height:31.02un; + min-width:16un; + min-height:12un; +} + +/****************************** TIMESTAMP TEXT ********************************/ + +MsgConversationWidget::timeStamp +{ + left:-var(hb-param-margin-gene-left); + right:1.0un; + bottom:var(hb-param-margin-gene-bottom); + text-align:left; + text-height:var(hb-param-text-height-tiny); + font-variant:primary; + text-line-count-max:1; + text-line-count-min:1; +} + +MsgConversationWidget[hasImage="true"]::timeStamp:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + +MsgConversationWidget[hasImage="false"][hasAudio="true"]::timeStamp:landscape +{ + left:-var(hb-param-margin-gene-middle-horizontal); +} + +/******************************* OVERLAY PLAY ICON ****************************/ + +MsgConversationWidget::playIcon +{ + zvalue:1; + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-primary-medium); + pref-height:var(hb-param-graphic-size-primary-medium); +} + +/******************************** AUDIO ICON **********************************/ + +MsgConversationWidget[hasAudio="true"]::audioIcon +{ + top:-var(hb-param-margin-gene-top); + left:-var(hb-param-margin-gene-left); + bottom:var(hb-param-margin-gene-middle-vertical); + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-primary-large); + pref-height:var(hb-param-graphic-size-primary-large); +} + +/* EOF */ \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget_color.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,65 @@ + +/********************************** BODYTEXT **********************************/ +MsgConversationWidget[isIncoming]::bodyText +{ + color:var(qtc_conv_list_received_normal); +} + +MsgConversationWidget[isIncoming][isUnread]::bodyText +{ + color:var(qtc_conv_list_received_highlight); +} + +MsgConversationWidget[!isIncoming]::bodyText +{ + color:var(qtc_conv_list_sent_highlight); +} + +MsgConversationWidget[!isIncoming][sendingState="Sent"]::bodyText +{ + color:var(qtc_conv_list_sent_normal); +} + +/********************************** SUBJECT ***********************************/ +MsgConversationWidget[isIncoming]::subject +{ + color:var(qtc_conv_list_received_normal); +} + +MsgConversationWidget[isIncoming][isUnread]::subject +{ + color:var(qtc_conv_list_received_highlight); +} + +MsgConversationWidget[!isIncoming]::subject +{ + color:var(qtc_conv_list_sent_highlight); +} + +MsgConversationWidget[!isIncoming][sendingState="Sent"]::subject +{ + color:var(qtc_conv_list_sent_normal); +} + +/****************************** TIMESTAMP TEXT ********************************/ +MsgConversationWidget[isIncoming]::timeStamp +{ + color:var(qtc_conv_list_received_normal); +} + +MsgConversationWidget[isIncoming][isUnread]::timeStamp +{ + color:var(qtc_conv_list_received_highlight); +} + +MsgConversationWidget[!isIncoming]::timeStamp +{ + color:var(qtc_conv_list_sent_highlight); +} + +MsgConversationWidget[!isIncoming][sendingState="Sent"]::timeStamp +{ + color:var(qtc_conv_list_sent_normal); +} + +/* EOF */ \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,30 @@ +MsgEditorWidget +{ + layout:layout-msg-editor; +} + +MsgEditorWidget::msgEditor +{ + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); + bottom:var(hb-param-margin-gene-middle-vertical); + top:-var(hb-param-margin-gene-middle-vertical); + min-height:7.46un; +} + +MsgEditorWidget::sendButton +{ + top:-var(hb-param-margin-gene-middle-vertical); + right:var(hb-param-margin-gene-middle-horizontal); + bottom:var(hb-param-margin-gene-middle-vertical); + fixed-width: 9.34un; + fixed-height: 7.46un; +} + +MsgEditorWidget::charCounter +{ + size-policy:fixed fixed; + pref-height:-1; + pref-width:-1; + text-height:var(hb-param-text-height-tiny); +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgcharcounter.cpp --- a/messagingapp/msgui/conversationview/src/msgcharcounter.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +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:Implements QT functionality to get message pdu details. - * - */ - -#include "msgcharcounter.h" -#include "msgcharcounter_p.h" - - - enum MsgCharSupport - { - msgCharSupportFull = 0, - msgCharSupportReduced - }; - -// --------------------------------------------------------------------------- -// Default Constructor. -// --------------------------------------------------------------------------- -// -MsgCharCounter::MsgCharCounter( QObject *parent ): - QObject( parent ) - { - d_ptr = MsgCharCounterPrivate::newL( this ); - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -MsgCharCounter::~MsgCharCounter() -{ - if (d_ptr) { - delete d_ptr; - d_ptr = NULL; - } -} - -// --------------------------------------------------------------------------- -// Sets the encoding settings. -// --------------------------------------------------------------------------- -// -void MsgCharCounter::setEncodingSettings() -{ - // Default values. - bool unicodeMode = false; - int alternativeEncodingType = 0; - int charSupportType = msgCharSupportFull; - - d_ptr->setEncodingSettings(unicodeMode, alternativeEncodingType, - charSupportType); -} - -// --------------------------------------------------------------------------- -// Gets the PDU details. -// --------------------------------------------------------------------------- -// -void MsgCharCounter::getNumPDUs(const QString &buf, - int &numOfRemainingChars, - int &numOfPDUs, - bool &unicodeMode, - int &alternativeEncodingType) -{ - d_ptr->getNumPDUs(buf, numOfRemainingChars, numOfPDUs, unicodeMode, - alternativeEncodingType); -} - -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgcharcounter_p.cpp --- a/messagingapp/msgui/conversationview/src/msgcharcounter_p.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +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:Implements Symbian functionality to get message pdu details. - * - */ -#include "msgcharcounter_p.h" - -#include -#include -#include -#include -#include - -#include "msgcharcounter.h" -#include "s60qconversions.h" - -enum MsgCharSupport -{ - msgCharSupportFull = 0, msgCharSupportReduced -}; - -// --------------------------------------------------------------------------- -// Default Constructor ( 1st phase ) -// --------------------------------------------------------------------------- -// -MsgCharCounterPrivate::MsgCharCounterPrivate(MsgCharCounter *msgCharCounter) : - q_ptr(msgCharCounter) -{ - // No implementation required -} - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -MsgCharCounterPrivate::~MsgCharCounterPrivate() -{ - q_ptr = NULL; - - if (mParaFormatLayer) - { - delete mParaFormatLayer; - mParaFormatLayer = NULL; - } - - if (mCharFormatLayer) - { - delete mCharFormatLayer; - mCharFormatLayer = NULL; - } - - if (mRichText) - { - delete mRichText; - mRichText = NULL; - } - - if (mSmsHeader) - { - delete mSmsHeader; - mSmsHeader = NULL; - } -} - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -MsgCharCounterPrivate* MsgCharCounterPrivate::newL( - MsgCharCounter *msgCharCounter) -{ - MsgCharCounterPrivate* self = new (ELeave) MsgCharCounterPrivate( - msgCharCounter); - CleanupStack::PushL(self); - self->constructL(); - CleanupStack::Pop(); // self; - return self; -} - -// --------------------------------------------------------------------------- -// EPOC default constructor for performing 2nd stage construction -// --------------------------------------------------------------------------- -// -void MsgCharCounterPrivate::constructL() -{ - mParaFormatLayer = CParaFormatLayer::NewL(); - mCharFormatLayer = CCharFormatLayer::NewL(); - mRichText = CRichText::NewL(mParaFormatLayer, mCharFormatLayer); - - mSmsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *mRichText); -} - -// --------------------------------------------------------------------------- -// To Set encoding settings like encoding type, character support and -// alternative encoding if any. -// --------------------------------------------------------------------------- -// -void MsgCharCounterPrivate::setEncodingSettings(bool unicodeMode, - int alternativeEncodingType, int charSupportType) -{ - TSmsUserDataSettings smsSettings; - CSmsMessage& smsMsg = mSmsHeader->Message(); - - mUnicodeMode = unicodeMode; - mCharSupportType = charSupportType; - mAlternativeEncodingType = (TSmsEncoding) alternativeEncodingType; - - if (mUnicodeMode) - { - smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabetUCS2); - } - else - { - smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet7Bit); - } - smsSettings.SetTextCompressed(EFalse); - smsMsg.SetUserDataSettingsL(smsSettings); - //First try without any alternate encoding - smsMsg.SetAlternative7bitEncoding(ESmsEncodingNone); -} - -// --------------------------------------------------------------------------- -// To get PDU Info: extracts details of number of PDUs, number of remaining -// chars in last PDU and encoding types used. -// --------------------------------------------------------------------------- -// -void MsgCharCounterPrivate::getNumPDUs(const QString &buf, - int &numOfRemainingChars, int &numOfPDUs, bool &unicodeMode, - int &alternativeEncodingType) -{ - TInt numOfUnconvChars; - TInt numOfDowngradedChars; - TInt isAltEncSupported; - TSmsEncoding currentAlternativeEncodingType; - - CSmsMessage& smsMsg = mSmsHeader->Message(); - - // need to set the input buffer to SMS buffer through iRichText - // (which is reference to SMS Buffer object) - HBufC* buffer = S60QConversions::qStringToS60Desc(buf); - CleanupStack::PushL(buffer); - mRichText->Reset(); - mRichText->InsertL(0, *buffer); - - //call SMS stack API to get PDU info - smsMsg.GetEncodingInfoL(numOfPDUs, numOfUnconvChars, numOfDowngradedChars, - numOfRemainingChars); - - //Algo to switch to Unicode if required - while ( (numOfUnconvChars || numOfDowngradedChars) && !mUnicodeMode) - { - currentAlternativeEncodingType = smsMsg.Alternative7bitEncoding(); - if (currentAlternativeEncodingType != mAlternativeEncodingType) - { - //try with this new alternative encoding type - isAltEncSupported = smsMsg.SetAlternative7bitEncoding( - mAlternativeEncodingType); - if (isAltEncSupported == KErrNotSupported) - { - // if required alternative encoding plugin is not supported, - // retain the existing encoding mechanism. - mAlternativeEncodingType = currentAlternativeEncodingType; - continue; - } - } - else if (numOfUnconvChars || (MsgCharSupport) mCharSupportType - == msgCharSupportFull) - { - //switch to Unicode - //mUnicodeMode = ETrue; - setEncodingSettings(ETrue, ESmsEncodingNone, mCharSupportType); - } - else - { - //Get out of while loop and return the results - break; - } - //get the PDU info with new settings - mRichText->Reset(); - mRichText->InsertL(0, *buffer); - smsMsg.GetEncodingInfoL(numOfPDUs, numOfUnconvChars, - numOfDowngradedChars, numOfRemainingChars); - } // end of while - - CleanupStack::PopAndDestroy(buffer); - unicodeMode = mUnicodeMode; - alternativeEncodingType = mAlternativeEncodingType; - if (mUnicodeMode) - { - // In case of Unicode mode, SMS Stack returns number of available free - // User Data units. Need to convert them w.r.t characters. - // Each char takse 2 UD units. - numOfRemainingChars = numOfRemainingChars / 2; - } -} - -//EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -22,15 +22,12 @@ #include #include #include -#include -#include +//#include +//#include #include #include -#include #include -#include -#include -#include +#include #include #include #include @@ -38,6 +35,7 @@ #include #include #include +#include #include @@ -46,8 +44,7 @@ #include "debugtraces.h" #include "conversationsengine.h" #include "convergedmessage.h" - -QTM_USE_NAMESPACE +#include "msgcontacthandler.h" // LOCAL CONSTANTS const QString DEFAULT_AVATAR_ICON("qtg_large_avatar"); @@ -55,7 +52,6 @@ const QString BACKGROUND_FRAME_NORMAL("qtg_fr_groupbox"); const QString GROUPBOX_BG_FRAME_PRESSED("qtg_fr_groupbox_pressed"); -const QString PLUGINPATH("conversationviewplugin.dll"); // LOCALIZATION CONSTANTS #define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files") @@ -63,28 +59,21 @@ #define LOC_COMMON_MENU_CALL hbTrId("txt_common_menu_call_verb") #define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts") +// LOCAL FUNCTIONS + //--------------------------------------------------------------- // MsgContactCardWidget::MsgContactCardWidget // @see header //--------------------------------------------------------------- MsgContactCardWidget::MsgContactCardWidget(QGraphicsItem *parent) : -HbWidget(parent), -mMenuShown(false), -mAvatarIconItem(NULL), -mPresenceIconItem(NULL), -mAddressTextItem(NULL), -mGestureFilter(NULL) - + HbWidget(parent), mMenuShown(false), mAvatarIconItem(NULL), mPresenceIconItem(NULL), + mAddressTextItem(NULL),mThumbnailManager(NULL) { - int baseId = style()->registerPlugin(PLUGINPATH); - QDEBUG_WRITE_FORMAT("MsgContactCardWidget BASE ID --->", baseId); - setPluginBaseId(baseId); - - init(); + init(); setBackGround(BACKGROUND_FRAME_NORMAL); connectSignals(true); - - connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(initGesture())); + + connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(initGesture())); } //--------------------------------------------------------------- @@ -93,12 +82,9 @@ //--------------------------------------------------------------- MsgContactCardWidget::~MsgContactCardWidget() { - style()->unregisterPlugin(PLUGINPATH); - - if(mGestureFilter) - { + /* if (mGestureFilter) { removeSceneEventFilter(mGestureFilter); - } + }*/ } //--------------------------------------------------------------- @@ -116,6 +102,13 @@ mAddressTextItem = new HbTextItem(this); HbStyle::setItemName(mAddressTextItem, "addressText"); + mThumbnailManager = new ThumbnailManager(this); + mThumbnailManager->setMode(ThumbnailManager::Default); + mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); + mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); + + connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), this, + SLOT(thumbnailReady(QPixmap, void*, int, int))); } //--------------------------------------------------------------- @@ -187,9 +180,8 @@ QString displayName; QString contactAddress; convId = ConversationsEngine::instance()->getCurrentConversationId(); - ConversationsEngine::instance()->getContactDetails(convId, displayName, - contactAddress); - + ConversationsEngine::instance()->getContactDetails(convId, displayName, contactAddress); + mContactNumber = contactAddress; QString contactName; if (displayName.isEmpty()) { @@ -198,21 +190,25 @@ else { contactName.append(displayName); } - + setAddress(contactName); // Set Avatar - HbIcon avatar; - QByteArray avatarByteArray = index.data(Avatar).toByteArray(); - if (avatarByteArray.isEmpty()) { - avatar = HbIcon(DEFAULT_AVATAR_ICON); + QList contactList = + MsgContactHandler::findContactList(mContactNumber); + + if (!contactList.isEmpty()) { + QList avatarDetails = + contactList.at(0).details (); + + if (!avatarDetails.isEmpty()) { + mThumbnailManager->getThumbnail( + avatarDetails.at(0).imageUrl().toString()); + } } - else { - QPixmap pixmap; - pixmap.loadFromData(avatarByteArray); - avatar = HbIcon(QIcon(pixmap)); - } - setAvatar(avatar); + + // Set default avatar till actual is set. + setAvatar(HbIcon(DEFAULT_AVATAR_ICON)); } } @@ -233,21 +229,20 @@ void MsgContactCardWidget::initGesture() { // Create gesture filter - QGraphicsScene* sc = this->scene(); - mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this ); - + /* QGraphicsScene* sc = this->scene(); + mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); + // Add gestures for longpress - HbGesture* gestureLongpressed = new HbGesture( HbGesture::longpress,5 ); - - mGestureFilter->addGesture( gestureLongpressed ); - - connect( gestureLongpressed, SIGNAL(longPress(QPointF)), - this, SLOT(handleLongPress(QPointF))); + HbGesture* gestureLongpressed = new HbGesture(HbGesture::longpress, 5); + + mGestureFilter->addGesture(gestureLongpressed); + + connect(gestureLongpressed, SIGNAL(longPress(QPointF)), this, SLOT(handleLongPress(QPointF))); //install gesture filter. this->installSceneEventFilter(mGestureFilter); - - disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(initGesture())); + + disconnect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(initGesture()));*/ } //--------------------------------------------------------------- @@ -255,17 +250,16 @@ // @see header file //--------------------------------------------------------------- void MsgContactCardWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ +{ mMenuShown = false; - + HbWidgetFeedback::triggered(this, Hb::InstantPressed); - + setBackGround(GROUPBOX_BG_FRAME_PRESSED); - + event->accept(); } - //--------------------------------------------------------------- // MsgContactCardWidget::mouseReleaseEvent // @see header file @@ -273,14 +267,13 @@ void MsgContactCardWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { setBackGround(BACKGROUND_FRAME_NORMAL); - - if(this->rect().contains(event->pos())&& !mMenuShown) - { + + if (this->rect().contains(event->pos()) && !mMenuShown) { HbWidgetFeedback::triggered(this, Hb::InstantClicked); - emit clicked(); - } - - event->accept(); + emit clicked(); + } + + event->accept(); } //--------------------------------------------------------------- @@ -288,13 +281,13 @@ // @see header file //--------------------------------------------------------------- void MsgContactCardWidget::setBackGround(const QString& bg) - { +{ HbFrameItem* backGround = new HbFrameItem(this); backGround->frameDrawer().setFrameGraphicsName(bg); backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - this->setBackgroundItem(backGround); + this->setBackgroundItem(backGround); this->repolish(); - } +} //--------------------------------------------------------------- // MsgContactCardWidget::handleLongPress @@ -302,46 +295,42 @@ //--------------------------------------------------------------- void MsgContactCardWidget::handleLongPress(QPointF position) { - if(KBluetoothMsgsConversationId - != ConversationsEngine::instance()->getCurrentConversationId()) - { + if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) { HbMenu* contextMenu = new HbMenu(); contextMenu->setDismissPolicy(HbPopup::TapAnywhere); contextMenu->setAttribute(Qt::WA_DeleteOnClose, true); contextMenu->setPreferredPos(position); - - contextMenu->addAction(LOC_MENU_CONTACT_INFO,this, SLOT(openContactInfo())); + + contextMenu->addAction(LOC_MENU_CONTACT_INFO, this, SLOT(openContactInfo())); contextMenu->addAction(LOC_COMMON_MENU_CALL, this, SLOT(call())); - + //If contact doesn't exist in phonebook then add another menu item "Save to Contacts" int contactId = resolveContactId(mContactNumber); - if(contactId < 0) - { + if (contactId < 0) { contextMenu->addAction(LOC_SAVETO_CONTACTS, this, SLOT(addToContacts())); } - + contextMenu->show(); - + mMenuShown = true; - } + } } //--------------------------------------------------------------- // MsgContactCardWidget::overrideFeedback // @see header file //--------------------------------------------------------------- -HbFeedback::InstantEffect MsgContactCardWidget::overrideFeedback(Hb::InstantInteraction interaction) const - { - switch(interaction) - { - case Hb::InstantPressed: - case Hb::InstantClicked: - return HbFeedback::Basic; - default: - return HbFeedback::NoOverride; - } - } - +/*HbFeedback::InstantEffect MsgContactCardWidget::overrideFeedback(Hb::InstantInteraction interaction) const +{ + switch (interaction) { + case Hb::InstantPressed: + case Hb::InstantClicked: + return HbFeedback::Basic; + default: + return HbFeedback::None; + } +}*/ + //--------------------------------------------------------------- // MsgContactCardWidget::openContactInfo // @see header @@ -350,40 +339,36 @@ { QString operation; QList args; - if(KBluetoothMsgsConversationId - != ConversationsEngine::instance()->getCurrentConversationId()) - { - int contactId = resolveContactId(mContactNumber); - if(contactId > 0) - { + if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) { + int contactId = resolveContactId(mContactNumber); + if (contactId > 0) { //open existing contact card operation = QString("open(int)"); args << contactId; } - else - { + else { //populate data and open unknown contact template operation = QString("editCreateNew(QString,QString)"); QString type = QContactPhoneNumber::DefinitionName; - + args << type; args << mAddress; } //service stuff. QString serviceName("com.nokia.services.phonebookservices"); - + XQAiwRequest* request; XQApplicationManager appManager; request = appManager.create(serviceName, "Fetch", operation, true); // embedded - if ( request == NULL ) - { - return; + if (request == NULL) { + return; } - + // Result handlers - connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); - connect (request, SIGNAL(requestError(const QVariant&)), this, SLOT(handleError(const QVariant&))); - + connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); + connect(request, SIGNAL(requestError(const QVariant&)), this, + SLOT(handleError(const QVariant&))); + request->setArguments(args); request->send(); delete request; @@ -396,28 +381,12 @@ //--------------------------------------------------------------- int MsgContactCardWidget::resolveContactId(const QString& value) { - int contactId = -1; - - QContactManager phonebookManager("symbian"); + QString displayLabel; - QContactDetailFilter phoneFilter; - phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); - phoneFilter.setValue(value); - phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); - - QList sortOrder; - QList matchingContacts = phonebookManager.contacts( - phoneFilter, - sortOrder, - QStringList()); - - if ( matchingContacts.count() > 0 ) - { - contactId = matchingContacts.at(0).localId(); - } - - return contactId; + return MsgContactHandler::resolveContactDisplayName( + value, + displayLabel, + 0); } //--------------------------------------------------------------- @@ -429,15 +398,14 @@ //Launch dialer service QString serviceName("com.nokia.services.telephony"); QString operation("dial(QString)"); - - XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false); - - connect(serviceRequest, SIGNAL(requestCompleted(QVariant)), - this, SLOT(onServiceRequestCompleted())); - - connect(serviceRequest, SIGNAL(requestError(int)), - this, SLOT(onServiceRequestCompleted())); - + + XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName, operation, false); + + connect(serviceRequest, SIGNAL(requestCompleted(QVariant)), this, + SLOT(onServiceRequestCompleted())); + + connect(serviceRequest, SIGNAL(requestError(int)), this, SLOT(onServiceRequestCompleted())); + *serviceRequest << mContactNumber; serviceRequest->send(); } @@ -457,22 +425,20 @@ void MsgContactCardWidget::handleOk(const QVariant& result) { Q_UNUSED(result) - - QContactManager phonebookManager("symbian"); + + QList matchingContacts = + MsgContactHandler::findContactList(mContactNumber); + + if (!matchingContacts.isEmpty()) { + setAddress(matchingContacts.at(0).displayLabel()); - QContactDetailFilter phoneFilter; - phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); - phoneFilter.setValue(mContactNumber); - phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); - - QList sortOrder; - QList matchingContacts = phonebookManager.contacts(phoneFilter, - sortOrder, QStringList()); - - if(matchingContacts.count()) - { - setAddress(matchingContacts.at(0).displayLabel()); + QList avatarDetails = + matchingContacts.at(0).details (); + + if (!avatarDetails.isEmpty()) { + mThumbnailManager->getThumbnail( + avatarDetails.at(0).imageUrl().toString()); + } } } @@ -481,11 +447,11 @@ // @see header //--------------------------------------------------------------- void MsgContactCardWidget::handleError(int errorCode, const QString& errorMessage) - { +{ Q_UNUSED(errorMessage) Q_UNUSED(errorCode) - } - +} + //--------------------------------------------------------------- // MsgContactCardWidget::onServiceRequestCompleted // @see header @@ -493,26 +459,40 @@ void MsgContactCardWidget::onServiceRequestCompleted() { //service request is now complete. delete it. - XQServiceRequest* request = qobject_cast(sender()); - if(request) - { + XQServiceRequest* request = qobject_cast (sender()); + if (request) { delete request; } } //--------------------------------------------------------------- +// MsgContactCardWidget::thumbnailReady +// @see header +//--------------------------------------------------------------- +void MsgContactCardWidget::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) +{ + Q_UNUSED(data) + Q_UNUSED(id) + + if (!error) { + QIcon icon(pixmap); + setAvatar(HbIcon(icon)); + } + else { + setAvatar(HbIcon(DEFAULT_AVATAR_ICON)); + } +} +//--------------------------------------------------------------- // MsgContactCardWidget::connectSignals // @see header //--------------------------------------------------------------- void MsgContactCardWidget::connectSignals(bool yes) { - if(yes) - { - connect(this,SIGNAL(clicked()),this,SLOT(openContactInfo())); + if (yes) { + connect(this, SIGNAL(clicked()), this, SLOT(openContactInfo())); } - else - { - disconnect(this,SIGNAL(clicked()),this,SLOT(openContactInfo())); + else { + disconnect(this, SIGNAL(clicked()), this, SLOT(openContactInfo())); } } // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp Fri May 14 15:49:35 2010 +0300 @@ -29,6 +29,8 @@ #include #include #include +#include +#include // USER INCLUDES #include "msgconversationview.h" @@ -36,6 +38,7 @@ #include "msgviewdefines.h" #include "conversationsenginedefines.h" #include "msgcontactcardwidget.h" +#include "conversationidpsconsts.h" QTM_USE_NAMESPACE @@ -48,8 +51,9 @@ //--------------------------------------------------------------- MsgConversationBaseView::MsgConversationBaseView(QGraphicsItem* parent) : MsgBaseView(parent), -mConversationView(NULL), -mConversationId(-1) +mConversationId(-1), +mCVIdkey(XQSettingsKey::TargetPublishAndSubscribe,KMsgCVIdProperty, + KMsgCVIdKey) { connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); initView(); @@ -73,6 +77,9 @@ mConversationId = convId; connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); + // publsih conversation id + mSettingsManager->writeItemValue(mCVIdkey,(int)mConversationId); + if(mConversationView) { mConversationView->refreshView(); @@ -123,7 +130,9 @@ mMainLayout->addItem(mConversationView); this->setLayout(mMainLayout); - + + mSettingsManager = new XQSettingsManager(this); + } //--------------------------------------------------------------- @@ -165,6 +174,15 @@ } } +//--------------------------------------------------------------- +// MsgConversationBaseView::conversationId +// get the conversation ID +//--------------------------------------------------------------- +qint64 MsgConversationBaseView::conversationId() + { + return mConversationId; + } + //--------------------------------------------------------------- // MsgConversationBaseView::clearContent // clears conversation view content @@ -201,8 +219,18 @@ void MsgConversationBaseView::doDelayedConstruction() { disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); + QTimer::singleShot(50,this,SLOT(handleViewReady())); +} + + +//--------------------------------------------------------------- +// MsgConversationBaseView::handleViewReady +// +//--------------------------------------------------------------- +void MsgConversationBaseView::handleViewReady() + { ConversationsEngine::instance()->fetchMoreConversations(); -} + } //--------------------------------------------------------------- // MsgConversationBaseView::hideChrome @@ -234,4 +262,17 @@ } } +//--------------------------------------------------------------- +// MsgConversationBaseView::setPSCVId +// +//--------------------------------------------------------------- +void MsgConversationBaseView::setPSCVId(bool setId) +{ + if(setId){ + mSettingsManager->writeItemValue(mCVIdkey,(int)mConversationId); + } + else { + mSettingsManager->writeItemValue(mCVIdkey,-1); + } +} // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgconversationview.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp Fri May 14 15:49:35 2010 +0300 @@ -23,8 +23,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -52,6 +54,7 @@ #include "unidatamodelplugininterface.h" #include "ringbc.h" #include "mmsconformancecheck.h" +#include "msgsettingsview.h" //Item specific menu. @@ -60,7 +63,7 @@ #define LOC_COMMON_FORWARD hbTrId("txt_common_menu_forward") #define LOC_COMMON_DOWNLOAD hbTrId("txt_messaging_menu_download") #define LOC_COMMON_SEND hbTrId("txt_common_menu_send") - +#define LOC_COMMON_SAVE hbTrId("txt_common_menu_save") #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete") #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") #define LOC_BUTTON_OK hbTrId("txt_common_button_ok") @@ -77,8 +80,10 @@ #define LOC_MSG_SEND_FAILED hbTrId("txt_messaging_dpopinfo_sending_failed") +#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_settings_incomplete") +#define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") -const QString PLUGINPATH("conversationviewplugin.dll"); + const int INVALID_MSGID = -1; const int INVALID_CONVID = -1; @@ -124,10 +129,15 @@ { // Create HbListView and set properties mConversationList = new HbListView(); - style()->registerPlugin(PLUGINPATH); + if (!HbStyleLoader::registerFilePath(":/layouts")) { + QDEBUG_WRITE("ERROR: ConversationView -> HbStyleLoader::registerFilePath"); + } mConversationList->setLayoutName("custom"); mConversationList->setItemRecycling(true); MsgConversationViewItem *item = new MsgConversationViewItem(this); + HbFrameBackground defaultBackground; + defaultBackground.setFrameGraphicsName(QString("")); + item->setDefaultFrame(defaultBackground); mConversationList->setItemPrototype(item); mConversationList->setSelectionMode(HbListView::NoSelection); mConversationList->setClampingStyle(HbScrollArea::BounceBackClamping); @@ -206,7 +216,7 @@ } else { mMainLayout->addItem(mEditorWidget); - mEditorWidget->setEncodingSettings(); + TRAP_IGNORE(mEditorWidget->setEncodingSettingsL()); mEditorWidget->show(); } mContactCardWidget->updateContents(); @@ -242,15 +252,18 @@ //If message is in Sending state or is Scheduled to be sent later, //do not allow any operations on the message int sendingState = item->modelIndex().data(SendingState).toInt(); + if(sendingState == ConvergedMessage::Scheduled || + sendingState == ConvergedMessage::Sending || + sendingState == ConvergedMessage::Waiting) + { + return; + } // Create new menu HbMenu* contextMenu = new HbMenu(); + contextMenu->setAttribute(Qt::WA_DeleteOnClose); + contextMenu->setPreferredPos(point); setContextMenu(item, contextMenu, sendingState); - - //Before showing menu reset the flag - mItemLongPressed = false; - contextMenu->exec(point); - // Cleanup - delete contextMenu; + contextMenu->show(); } else @@ -271,7 +284,25 @@ addResendItemToContextMenu(item, contextMenu, sendingState); addForwardItemToContextMenu(item, contextMenu, sendingState); addDownloadItemToContextMenu(item, contextMenu); - addDeleteItemToContextMenu(item, contextMenu, sendingState); + addDeleteItemToContextMenu(item, contextMenu, sendingState); + addSaveItemToContextMenu(item , contextMenu,sendingState); +} + + +//--------------------------------------------------------------- +// MsgEditorPrivate::addSaveItemToContextMenu +// @see header +//--------------------------------------------------------------- +void MsgConversationView::addSaveItemToContextMenu(MsgConversationViewItem* item, + HbMenu* contextMenu, int sendingState) +{ + int messageSubType = item->modelIndex().data(MessageSubType).toInt(); + int direction = item->modelIndex().data(Direction).toInt(); + if ((messageSubType == ConvergedMessage::RingingTone) && + (direction == ConvergedMessage::Incoming)) { + HbAction *contextItem = contextMenu->addAction(LOC_COMMON_SAVE); + connect(contextItem, SIGNAL(triggered()), this, SLOT(saveRingingTone())); + } } //--------------------------------------------------------------- @@ -431,17 +462,7 @@ deactivateInputBlocker(); if( sendResult == KErrNotFound) { - bool result = HbMessageBox::question("SMS Settings not defined\nDefine now ?", - LOC_BUTTON_OK, - LOC_BUTTON_CANCEL); - if (result) - { - //switch to settings view - QVariantList param; - param << MsgBaseView::MSGSETTINGS; - param << MsgBaseView::CV; - emit switchView(param); - } + HbMessageBox::question(LOC_DIALOG_SMS_SETTINGS_INCOMPLETE, this, SLOT(onDialogSettingsLaunch(HbAction*)), LOC_BUTTON_OK, LOC_BUTTON_CANCEL); } } @@ -519,7 +540,8 @@ QString operation("fetch(QVariantMap,QVariant)"); XQAiwRequest* request = NULL; XQApplicationManager appManager; - request = appManager.create(interface, operation, true);//embedded + request = appManager.create(interface, operation, true); // embedded + request->setSynchronous(true); // synchronous if(!request) { QDEBUG_WRITE("AIW-ERROR: NULL request"); @@ -530,7 +552,12 @@ this, SLOT(imagesFetched(const QVariant&))); connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(serviceRequestError(int,const QString&))); - + + // Set arguments for request + QList args; + args << QVariantMap(); + args << QVariant(); + request->setArguments(args); // Make the request if (!request->send()) { @@ -545,12 +572,13 @@ //--------------------------------------------------------------- void MsgConversationView::fetchAudio() { - QString service("Music Fetcher"); - QString interface("com.nokia.services.media.Music"); - QString operation("fetch(QString)"); + QString service("musicplayer"); + QString interface("com.nokia.symbian.IMusicFetch"); + QString operation("fetch()"); XQAiwRequest* request = NULL; XQApplicationManager appManager; request = appManager.create(service, interface, operation, true); //embedded + request->setSynchronous(true); // synchronous if(!request) { QDEBUG_WRITE("AIW-ERROR: NULL request"); @@ -576,38 +604,16 @@ //--------------------------------------------------------------- void MsgConversationView::contactsFetched(const QVariant& value) { - CntServicesContactList contactList; - contactList = qVariantValue(value); - ConvergedMessageAddressList addresses; + CntServicesContactList contactList = + qVariantValue(value); int count = contactList.count(); if(count > 0) - { - ConvergedMessageAddress* address = new ConvergedMessageAddress; - address->setAlias(mContactCardWidget->address().at(0)->alias()); - address->setAddress(mContactCardWidget->address().at(0)->address()); - addresses.append(address); - for(int i = 0; i < contactList.count(); i++ ) - { - ConvergedMessageAddress* address = new ConvergedMessageAddress; - address->setAlias(contactList[i].mDisplayName); - address->setAddress(contactList[i].mPhoneNumber); - addresses.append(address); - } - - ConvergedMessage message; - message.setBodyText(mEditorWidget->content()); - message.addToRecipients(addresses);//takes the ownership of list elements - QByteArray dataArray; - QDataStream messageStream - (&dataArray, QIODevice::WriteOnly | QIODevice::Append); - message.serialize(messageStream); - QVariantList params; - params << MsgBaseView::UNIEDITOR; // target view - params << MsgBaseView::CV; // source view - params << dataArray; - clearEditors(); - emit switchView(params); - } + { + QVariantList params; + params << MsgBaseView::ADD_RECIPIENTS; + params << value; + launchUniEditor(params); + } } //--------------------------------------------------------------- @@ -731,31 +737,9 @@ //--------------------------------------------------------------- void MsgConversationView::deleteItem() { - QModelIndex index = mConversationList->currentIndex(); - int count = mMessageModel->rowCount(); - //delete message - qint32 messageId = index.data(ConvergedMsgId).toLongLong(); - - bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, + HbMessageBox::question(LOC_DELETE_MESSAGE,this,SLOT(onDialogdeleteMsg(HbAction*)), LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - if(result) - { - if (messageId) - { - QList msgIdList; - msgIdList.append(messageId); - ConversationsEngine::instance()->deleteMessages(msgIdList); - //switch view - if (count == 1) - { - QVariantList param; - param << MsgBaseView::CLV; // target view - param << MsgBaseView::CV; // source view - emit switchView(param); - } - } - } } //--------------------------------------------------------------- @@ -885,22 +869,37 @@ } if(mItemLongPressed) + { + //reset the flag + mItemLongPressed = false; return; + } int messageType = index.data(MessageType).toInt(); int messageSubType = index.data(MessageSubType).toInt(); if (ConvergedMessage::BioMsg == messageType) { if (ConvergedMessage::RingingTone == messageSubType) { - if (RingBc::askSaveQuery()) { - saveRingingTone(); - } + HbMessageBox::question(LOC_DIALOG_SAVE_RINGTONE, this, + SLOT(onDialogSaveTone(HbAction*)), LOC_COMMON_SAVE, LOC_BUTTON_CANCEL); return; } + else if(ConvergedMessage::Provisioning == messageSubType) + { + int messageId = index.data(ConvergedMsgId).toInt(); + handleProvisoningMsg(messageId); + QList msgIdList; + if(index.data(UnReadStatus).toInt()) + { + msgIdList.clear(); + msgIdList << messageId; + ConversationsEngine::instance()->markMessagesRead(msgIdList); + } + return; + } // Unsupported messages else if (ConvergedMessage::VCard == messageSubType - || ConvergedMessage::VCal == messageSubType - || ConvergedMessage::Provisioning == messageSubType) { + || ConvergedMessage::VCal == messageSubType) { return; } } @@ -923,12 +922,9 @@ else { //TODO: use logical str name - if(HbMessageBox::question("Download Message?", + HbMessageBox::question("Download Message?",this,SLOT(onDialogDownLoadMsg(HbAction*)), LOC_COMMON_DOWNLOAD, - LOC_BUTTON_CANCEL)) - { - downloadMessage(); - } + LOC_BUTTON_CANCEL); return; } } @@ -1050,6 +1046,7 @@ { message.setBodyText(mEditorWidget->content()); + // add address from contact-card to to-field ConvergedMessageAddress address; address.setAlias(mContactCardWidget->address().at(0)->alias()); address.setAddress(mContactCardWidget->address().at(0)->address()); @@ -1077,6 +1074,21 @@ // instead, we will get a list of contacts. Pass it as it is. data2 = data.at(1); } + else if(editorOperation == MsgBaseView::ADD_RECIPIENTS) + { + ConvergedMessageAddressList addresses; + CntServicesContactList contactList = + qVariantValue(data.at(1)); + // now add fetched contacts from contact selection dialog + for(int i = 0; i < contactList.count(); i++ ) + { + ConvergedMessageAddress* address = new ConvergedMessageAddress; + address->setAlias(contactList[i].mDisplayName); + address->setAddress(contactList[i].mPhoneNumber); + addresses.append(address); + } + message.addToRecipients(addresses); + } } else { @@ -1223,6 +1235,8 @@ this->setMaximumHeight(-1); connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened())); + + scrollToBottom(); } //--------------------------------------------------------------- @@ -1254,5 +1268,107 @@ this->ungrabMouse(); } +//--------------------------------------------------------------- +// MsgConversationView::handleProvisoningMsg +// @see header file +//-------------------------------------------------------------- +void MsgConversationView::handleProvisoningMsg(int msgId) + { + QString messageId; + messageId.setNum(msgId); + + XQApplicationManager* aiwMgr = new XQApplicationManager(); + + XQAiwRequest* request = aiwMgr->create("com.nokia.services.MDM", + "Provisioning", + "ProcessMessage(QString)", true); // embedded + + if (request) { + QList args; + args << QVariant(messageId); + request->setArguments(args); + + // Send the request + bool res = request->send(); + + // Cleanup + delete request; + } + + delete aiwMgr; + } + +//--------------------------------------------------------------- +// MsgConversationView::onDialogSettingsLaunch +// @see header file +//-------------------------------------------------------------- +void MsgConversationView::onDialogSettingsLaunch(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + //switch to settings view + QVariantList param; + param << MsgBaseView::MSGSETTINGS; + param << MsgBaseView::CV; + param << MsgSettingsView::SMSView; + emit switchView(param); + } + +} + +//--------------------------------------------------------------- +// MsgConversationView::onDialogdeleteMsg +// @see header file +//-------------------------------------------------------------- +void MsgConversationView::onDialogdeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + QModelIndex index = mConversationList->currentIndex(); + if (index.isValid()) { + int count = mMessageModel->rowCount(); + //delete message + qint32 messageId = index.data(ConvergedMsgId).toLongLong(); + if (messageId) { + QList msgIdList; + msgIdList.append(messageId); + ConversationsEngine::instance()->deleteMessages(msgIdList); + //switch view + if (count == 1) { + QVariantList param; + param << MsgBaseView::CLV; // target view + param << MsgBaseView::CV; // source view + emit switchView(param); + } + } + } + + } + +} + +//--------------------------------------------------------------- +// MsgConversationView::onDialogDownLoadMsg +// @see header file +//-------------------------------------------------------------- +void MsgConversationView::onDialogDownLoadMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + downloadMessage(); + } +} + +//--------------------------------------------------------------- +// MsgConversationView::onDialogSaveTone +// @see header file +//-------------------------------------------------------------- +void MsgConversationView::onDialogSaveTone(HbAction* action) + { + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + saveRingingTone(); + } +} // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp Fri May 14 15:49:35 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include // USER INCLUDES #include "msgconversationwidget.h" @@ -56,11 +57,6 @@ HbListViewItem(parent), mIncoming(false), mConversation(0), mMessageStateIconItem(0) { - mConversation = new MsgConversationWidget(this); - HbStyle::setItemName(mConversation, "msgconvwidget"); - - mMessageStateIconItem = new HbIconItem(this); - HbStyle::setItemName(mMessageStateIconItem, "msgStateIcon"); } //--------------------------------------------------------------- @@ -69,7 +65,6 @@ //--------------------------------------------------------------- MsgConversationViewItem::~MsgConversationViewItem() { - } //--------------------------------------------------------------- @@ -77,16 +72,23 @@ // Create a new decorator item. //--------------------------------------------------------------- MsgConversationViewItem* MsgConversationViewItem::createItem() -{ - return new MsgConversationViewItem(); -} + { + return new MsgConversationViewItem(*this); + } //--------------------------------------------------------------- // MsgConversationViewItem::updateChildItems // //--------------------------------------------------------------- void MsgConversationViewItem::updateChildItems() -{ + { + + if (!mMessageStateIconItem) + { + mMessageStateIconItem = new HbIconItem(this); + HbStyle::setItemName(mMessageStateIconItem, "msgStateIcon"); + } + QModelIndex index = modelIndex(); #ifdef _DEBUG_TRACES_ @@ -94,192 +96,284 @@ << index.data(ConvergedMsgId).toInt(); #endif - // Create items common to each type of message - - QString bodyText = index.data(BodyText).toString(); int messageType = index.data(MessageType).toInt(); int messageSubType = index.data(MessageSubType).toInt(); - // Set message properties common to SMS/MMS/IM etc.. + + if (messageType == ConvergedMessage::Sms) + { + updateSmsTypeItem(index); + } + else if (messageType == ConvergedMessage::Mms || messageType + == ConvergedMessage::MmsNotification || messageType + == ConvergedMessage::BT) + { + updateMmsTypeItem(index, messageType, messageSubType); + } + else if (messageType == ConvergedMessage::BioMsg) + { + if (messageSubType == ConvergedMessage::VCard || messageSubType + == ConvergedMessage::RingingTone) + { + updateMmsTypeItem(index, messageType, messageSubType); + } + else + { + updateSmsTypeItem(index, messageSubType); + } + } +#ifdef _DEBUG_TRACES_ + qCritical() << "END MsgConversationViewItem::updateChildItems: " + << index.data(ConvergedMsgId).toInt(); +#endif + + repolish(); + HbListViewItem::updateChildItems(); + } + +//--------------------------------------------------------------- +// MsgConversationViewItem::updateSmsTypeItem +// @see header file +//--------------------------------------------------------------- +void MsgConversationViewItem::updateSmsTypeItem(const QModelIndex& index, int messageSubType) + { + + if (!mConversation) + { + mConversation = new MsgConversationWidget(this); + HbStyle::setItemName(mConversation, "msgconvwidget"); + } + mIncoming = false; + mConversation->resetProperties(); + int direction = index.data(Direction).toInt(); - - if ( direction == ConvergedMessage::Incoming) - { + + if (direction == ConvergedMessage::Incoming) + { setIncoming(true); mConversation->setIncoming(true); - - if(messageType == ConvergedMessage::MmsNotification) - { - mConversation->setMMSNotification(true); - int notificationState = index.data(NotificationStatus).toInt(); - mConversation->setNotificationState(notificationState); - setNotificationStateIcon(notificationState); + + mMessageStateIconItem->setVisible(false); } - else + else if (direction == ConvergedMessage::Outgoing) { - mMessageStateIconItem->setVisible(false); - } - } - else if (direction == ConvergedMessage::Outgoing) - { setIncoming(false); mConversation->setIncoming(false); int sendingState = index.data(SendingState).toInt(); mConversation->setSendingState(sendingState); setMessageStateIcon(sendingState); - } + } bool unreadStatus = index.data(UnReadStatus).toBool(); mConversation->setUnread(unreadStatus); - // Create items common to SMS/MMS/IM etc... + mConversation->drawBubbleFrame(); mConversation->drawNewItemFrame(); QDateTime dateTime; dateTime.setTime_t(index.data(TimeStamp).toUInt()); - QString resendStateNote((index.data(SendingState).toInt() == ConvergedMessage::Resend)? LOC_RESEND_AT : ""); + QString resendStateNote((index.data(SendingState).toInt() + == ConvergedMessage::Resend) ? LOC_RESEND_AT : ""); if (dateTime.date() == QDateTime::currentDateTime().date()) - { + { + + mConversation->setTimeStamp(resendStateNote + dateTime.toString( + TIME_FORMAT)); + } + else + { + mConversation->setTimeStamp(resendStateNote + dateTime.toString( + DATE_FORMAT)); + } - mConversation->setTimeStamp(resendStateNote + dateTime.toString(TIME_FORMAT)); - } + if (messageSubType == ConvergedMessage::VCal) + { + mConversation->setSubject(LOC_UNSUPPORTED_MSG_TYPE); + } else - { - mConversation->setTimeStamp(resendStateNote + dateTime.toString(DATE_FORMAT)); + { + QString bodyText = index.data(BodyText).toString(); + bodyText.replace(QChar::ParagraphSeparator, QChar::LineSeparator); + bodyText.replace('\r', QChar::LineSeparator); + mConversation->setSubject(bodyText); + } + + //repolish + mConversation->repolishWidget(); } - QDEBUG_WRITE_FORMAT("MsgConversationViewItem::updateChildItems msg type value",messageType) - - if (messageType == ConvergedMessage::Sms || - messageType == ConvergedMessage::IM) +//--------------------------------------------------------------- +// MsgConversationViewItem::updateMmsTypeItem +// @see header file +//--------------------------------------------------------------- +void MsgConversationViewItem::updateMmsTypeItem(const QModelIndex& index, + int messageType, int messageSubType) { - mConversation->setMMS(false); - bodyText.replace(QChar::ParagraphSeparator, QChar::LineSeparator); - bodyText.replace('\r', QChar::LineSeparator); - mConversation->setBodyText(bodyText); - } - else if (messageType == ConvergedMessage::Mms) - { - mConversation->setMMS(true); - QString attachments = index.data(Attachments).toString(); + // create widget + if (!mConversation) + { + mConversation = new MsgConversationWidget(this); + HbStyle::setItemName(mConversation, "msgconvwidget"); + } + mIncoming = false; + mConversation->resetProperties(); + + mConversation->setMMS(true); + int direction = index.data(Direction).toInt(); + QString bodyText = index.data(BodyText).toString(); + + if (direction == ConvergedMessage::Incoming) + { + setIncoming(true); + mConversation->setIncoming(true); + + if (messageType == ConvergedMessage::MmsNotification) + { + mConversation->setMMSNotification(true); + int notificationState = index.data(NotificationStatus).toInt(); + mConversation->setNotificationState(notificationState); + setNotificationStateIcon(notificationState); + } + else + { + mMessageStateIconItem->setVisible(false); + } + } + else if (direction == ConvergedMessage::Outgoing) + { + setIncoming(false); + mConversation->setIncoming(false); + + int sendingState = index.data(SendingState).toInt(); + mConversation->setSendingState(sendingState); + setMessageStateIcon(sendingState); + } + + bool unreadStatus = index.data(UnReadStatus).toBool(); + mConversation->setUnread(unreadStatus); + + mConversation->drawBubbleFrame(); + mConversation->drawNewItemFrame(); + + QDateTime dateTime; + dateTime.setTime_t(index.data(TimeStamp).toUInt()); + QString resendStateNote((index.data(SendingState).toInt() + == ConvergedMessage::Resend) ? LOC_RESEND_AT : ""); + if (dateTime.date() == QDateTime::currentDateTime().date()) + { + + mConversation->setTimeStamp(resendStateNote + dateTime.toString( + TIME_FORMAT)); + } + else + { + mConversation->setTimeStamp(resendStateNote + dateTime.toString( + DATE_FORMAT)); + } + + if (messageType == ConvergedMessage::Mms) + { + //preview path + QString previewPath = index.data(Attachments).toString(); QString subject = index.data(Subject).toString(); - bool hasAttachments = (index.data(MessageProperty).toInt() - & ConvergedMessage::Attachment) ? true : false; + int msgProperty = index.data(MessageProperty).toInt(); + bool hasAttachments = (msgProperty & EPreviewAttachment) ? true : false; if (hasAttachments) - { + { mConversation->setAttachment(); - } + } else - { + { mConversation->setAttachment(false); - } - QStringList mediaFiles = attachments.split('|', - QString::SkipEmptyParts); - //Can be used for preview icon - QStringList imageFiles; - - MsgViewUtils viewUtils; - - for (int i = 0; i < mediaFiles.size(); ++i) - { - QString type = viewUtils.mimeTypeL(QDir::toNativeSeparators( - mediaFiles.at(i))); + } + + // Now set the media contents + + //preview image + bool hasImage = (msgProperty & EPreviewImage) ? true : false; - if (type.contains("image")) + if (hasImage) { - imageFiles << mediaFiles.at(i); - mConversation->setImage(true); - } - else if (type.contains("video")) - { - mConversation->setVideo(false); + int msgId = index.data(ConvergedMsgId).toInt(); + mConversation->setPreviewIconPath(previewPath, msgId); + mConversation->setImage(true); } - else if (type.contains("audio")) + + bool hasVideo = (msgProperty & EPreviewVideo) ? true : false; + + if (hasVideo) { - mConversation->setAudio(true); + mConversation->setVideo(true); } - } - // Now set the media contents - if (!imageFiles.isEmpty()) - { - mConversation->setPreviewIconPath(imageFiles.at(0)); - } + + bool hasAudio = (msgProperty & EPreviewAudio) ? true : false; + if (hasAudio) + { + mConversation->setAudio(true); + } + mConversation->displayAudioIcon(); int priority = index.data(MessagePriority).toInt(); mConversation->setPriority(priority); mConversation->setSubject(subject); - mConversation->setBodyText(bodyText); - } // END of ConvergedMessage::Mms + mConversation->setBodyText(bodyText); + } else if (messageType == ConvergedMessage::BioMsg) - { + { if (messageSubType == ConvergedMessage::RingingTone) - { - mConversation->setMMS(true); + { mConversation->setImage(false); mConversation->setAudio(true); mConversation->displayAudioIcon(); mConversation->setSubject(LOC_RINGING_TONE); - } + } else if (messageSubType == ConvergedMessage::VCard) - { - mConversation->setMMS(true); + { mConversation->setImage(false); mConversation->setAudio(true); mConversation->displayAudioIcon(VCARD_ICON); mConversation->setSubject(LOC_BUSINESS_CARD); mConversation->setBodyText(bodyText); + } } - else + else if (messageType == ConvergedMessage::BT) { - mConversation->setMMS(false); - mConversation->setBodyText(LOC_UNSUPPORTED_MSG_TYPE); - } - } - else if (messageType == ConvergedMessage::BT) - { - mConversation->setMMS(true); QString deviceName = index.data(ConversationAddress).toString(); mConversation->setSubject(deviceName); QString blueToothBody; if (messageSubType == ConvergedMessage::VCard) - { + { mConversation->setImage(false); mConversation->setAudio(true); mConversation->displayAudioIcon(VCARD_ICON); blueToothBody.append(LOC_BUSINESS_CARD); blueToothBody.append(QChar::LineSeparator); blueToothBody.append(bodyText); - } + } else - { + { blueToothBody.append(bodyText); - } + } mConversation->setBodyText(blueToothBody); - } - else if(messageType == ConvergedMessage::MmsNotification) - { - mConversation->setMMS(true); - + } + else if (messageType == ConvergedMessage::MmsNotification) + { QString subject = index.data(Subject).toString(); int priority = index.data(MessagePriority).toInt(); mConversation->setPriority(priority); mConversation->setSubject(subject); mConversation->setBodyText(bodyText); + } + + //repolish widget + mConversation->repolishWidget(); } -#ifdef _DEBUG_TRACES_ - qCritical() << "END MsgConversationViewItem::updateChildItems: " - << index.data(ConvergedMsgId).toInt(); -#endif - - HbListViewItem::updateChildItems(); -} - //--------------------------------------------------------------- // MsgConversationViewItem::containsPoint // @@ -318,7 +412,6 @@ HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global(); switch (messageState) { - case ConvergedMessage::Waiting: case ConvergedMessage::Scheduled: case ConvergedMessage::Sending: @@ -376,7 +469,6 @@ HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global(); switch (notificationState) { - case ConvergedMessage::NotifRetrieving: case ConvergedMessage::NotifWaiting: { diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgconversationwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -25,11 +25,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include + #include "debugtraces.h" #include "convergedmessage.h" - -const int MAX_SIZE(200); +#include "conversationsengine.h" // Icons const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high"); @@ -49,6 +56,9 @@ const QString CV_SENT_HIGHLIGHT_FR("qtg_fr_convlist_sent_highlight"); const QString NEW_ITEM_FRAME("qtg_fr_list_new_item"); +//selecet preview-icon query +_LIT(KSelectPreviewIconStmt,"SELECT message_id, preview_icon FROM conversation_messages WHERE message_id = :message_id "); + //--------------------------------------------------------------- // MsgConversationWidget::MsgConversationWidget // @see header file @@ -65,7 +75,7 @@ mIsMMS(false), mIsMMSNotification(false), mPriority(0), - mSendingState(0), + mSendingState(Unknown), mNotificationState(0), mNewFrameItem(NULL), mBubbleFrameItem(NULL), @@ -102,24 +112,14 @@ // Common to SMS/MMS mBubbleFrameItem = new HbFrameItem(this); - // ZValue is set to make the bubble to be rendered in behind text items. - mBubbleFrameItem->setZValue(-1.0); mBubbleFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); HbStyle::setItemName(mBubbleFrameItem, "bubble"); - mBodyTextItem = new HbTextItem(this); - mBodyTextItem->setTextWrapping(Hb::TextWordWrap); - HbStyle::setItemName(mBodyTextItem, "bodyText"); - - mTimeStampTextItem = new HbTextItem(this); - HbStyle::setItemName(mTimeStampTextItem, "timeStamp"); - mNewFrameItem = new HbFrameItem(this); + mNewFrameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); HbStyle::setItemName(mNewFrameItem, "newItemIcon"); - - mAttachmentIconItem = new HbIconItem(this); - HbStyle::setItemName(mAttachmentIconItem, "attachment"); -} + + } //--------------------------------------------------------------- // MsgConversationWidget::setSubject @@ -129,10 +129,12 @@ { if (!mSubjectTextItem) { - mSubjectTextItem = new HbTextItem(this); - HbStyle::setItemName(mSubjectTextItem, "subject"); + mSubjectTextItem = new HbTextItem(this); + mSubjectTextItem->setTextWrapping(Hb::TextWordWrap); } + HbStyle::setItemName(mSubjectTextItem, "subject"); mSubjectTextItem->setText(subject); + mSubjectTextItem->show(); } //--------------------------------------------------------------- @@ -141,49 +143,118 @@ //--------------------------------------------------------------- void MsgConversationWidget::setBodyText(const QString &body) { + if (!mBodyTextItem) + { + mBodyTextItem = new HbTextItem(this); + mBodyTextItem->setTextWrapping(Hb::TextWordWrap); + } + HbStyle::setItemName(mBodyTextItem, "bodyText"); + mBodyTextItem->setText(body); + mBodyTextItem->show(); } //--------------------------------------------------------------- // MsgConversationWidget::setPreviewIconPath // @see header file //--------------------------------------------------------------- -void MsgConversationWidget::setPreviewIconPath(const QString &previewPath) +void MsgConversationWidget::setPreviewIconPath(const QString &filePath,int msgId) { if (!mPreviewIconItem) { mPreviewIconItem = new HbIconItem(this); - mPreviewIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); - HbStyle::setItemName(mPreviewIconItem, "preview"); + mPreviewIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); } - if (previewPath.isEmpty()) - { - mPreviewIconItem->setEnabled(false); - } - else + HbStyle::setItemName(mPreviewIconItem, "preview"); + //sql query to get preview-icon from DB + TBool isOpen = EFalse; + bool imagePreviewed = false; + + //get DB handle and check if it is open + RSqlDatabase& sqlDb = ConversationsEngine::instance()->getDBHandle(isOpen); + if (isOpen) { - QImageReader iReader(previewPath); - QSize size(iReader.size()); - - if(size.height() > MAX_SIZE || size.width() > MAX_SIZE) + RSqlStatement sqlSelectPreviewIconStmt; + TInt err = sqlSelectPreviewIconStmt.Prepare(sqlDb, + KSelectPreviewIconStmt); + + QCRITICAL_WRITE_FORMAT("Error from Prepare()", err) + + if (err == KErrNone) { - size.scale(MAX_SIZE,MAX_SIZE,Qt::KeepAspectRatio); - iReader.setScaledSize(size); + //msg_id + TInt msgIdIndex = sqlSelectPreviewIconStmt.ParameterIndex( + _L(":message_id")); + sqlSelectPreviewIconStmt.BindInt(msgIdIndex, msgId); + + // get preview-icon from DB + err = sqlSelectPreviewIconStmt.Next(); + QCRITICAL_WRITE_FORMAT("Error from Next()", err) + + if (err == KSqlAtRow) + { + TInt previewIconIndex = sqlSelectPreviewIconStmt.ColumnIndex( + _L("preview_icon")); + + RSqlColumnReadStream stream; + + //Get data from binary column BLOB + err = stream.ColumnBinary(sqlSelectPreviewIconStmt, + previewIconIndex); + + QCRITICAL_WRITE_FORMAT("Error from ColumnBinary()", err) + + if (err == KErrNone) + { + CFbsBitmap *bitmap = new CFbsBitmap; + TRAPD(err,bitmap->InternalizeL(stream)); + QCRITICAL_WRITE_FORMAT("Error from bitmap InternalizeL()", err) - QImage icon = iReader.read(); - QPixmap pixmap = QPixmap::fromImage(icon); - - mPreviewIconItem->setIcon(HbIcon(pixmap)); + //convert bitmap to pixmap + if (err == KErrNone) + { + TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength(size.iWidth, + bitmap->DisplayMode()); + const uchar* dataPtr = + (const uchar*) bitmap->DataAddress(); + + QPixmap pixmap = QPixmap::fromImage(QImage(dataPtr, + size.iWidth, size.iHeight, bytesPerLine, + QImage::Format_RGB16)); + + mPreviewIconItem->setIcon(HbIcon(pixmap)); + mPreviewIconItem->setPreferredSize(pixmap.size()); + mPreviewIconItem->setEnabled(true); + mPreviewIconItem->show(); + imagePreviewed = true; + + QCRITICAL_WRITE("Bitmap Conversion completed") + } + //remove bitmap + delete bitmap; + } + //close stream + stream.Close(); + } } - else - { - QPixmap pixmap(previewPath); - mPreviewIconItem->setIcon(HbIcon(pixmap)); - } - - mPreviewIconItem->setEnabled(true); + sqlSelectPreviewIconStmt.Close(); } + + // if not found in db, set from file path + if(!imagePreviewed) + { + QPixmap pixmap(filePath); + QPixmap scaledPixmap =pixmap.scaled(100,100,Qt::IgnoreAspectRatio); + mPreviewIconItem->setIcon(HbIcon(scaledPixmap)); + mPreviewIconItem->setPreferredSize(scaledPixmap.size()); + mPreviewIconItem->setEnabled(true); + mPreviewIconItem->show(); + } + + QCRITICAL_WRITE("MsgConversationWidget::setPreviewIconPath end.") + } //--------------------------------------------------------------- @@ -198,10 +269,9 @@ { if (!mPriorityIconItem) { - mPriorityIconItem = new HbIconItem(this); - HbStyle::setItemName(mPriorityIconItem, "priority"); + mPriorityIconItem = new HbIconItem(this); } - + HbStyle::setItemName(mPriorityIconItem, "priority"); if (ConvergedMessage::Low == priority) { mPriorityIconItem->setIcon(HbIcon(MSG_LOW_PRIORITY_ICON)); @@ -210,6 +280,7 @@ { mPriorityIconItem->setIcon(HbIcon(MSG_HIGH_PRIORITY_ICON)); } + mPriorityIconItem->show(); } } @@ -232,7 +303,13 @@ if (attachment) { + if (!mAttachmentIconItem) + { + mAttachmentIconItem = new HbIconItem(this); + } + HbStyle::setItemName(mAttachmentIconItem, "attachment"); mAttachmentIconItem->setIcon(HbIcon(MSG_ATTACH_ICON)); + mAttachmentIconItem->show(); } } @@ -293,19 +370,22 @@ { if (!mPlayIconItem) { - mPlayIconItem = new HbIconItem(this); - HbStyle::setItemName(mPlayIconItem, "playIcon"); + mPlayIconItem = new HbIconItem(this); } + HbStyle::setItemName(mPlayIconItem, "playIcon"); mPlayIconItem->setIconName(iconPath.isEmpty() ? MSG_AUDIO_PLAY_ICON : iconPath); + mPlayIconItem->show(); } else { if (!mAudioIconItem) { - mAudioIconItem = new HbIconItem(this); - HbStyle::setItemName(mAudioIconItem, "audioIcon"); + mAudioIconItem = new HbIconItem(this); } + HbStyle::setItemName(mAudioIconItem, "audioIcon"); mAudioIconItem->setIconName(iconPath.isEmpty() ? MSG_AUDIO_PLAY_ICON : iconPath); + mAudioIconItem->show(); + } } } @@ -323,9 +403,11 @@ if (!mVideoIconItem) { mVideoIconItem = new HbIconItem(this); - HbStyle::setItemName(mVideoIconItem, "video"); } + HbStyle::setItemName(mVideoIconItem, "video"); mVideoIconItem->setIcon(HbIcon(MSG_VIDEO_ICON)); + mVideoIconItem->show(); + } } @@ -439,7 +521,6 @@ case ConvergedMessage::SentState: { mSendingState = Sent; - repolish(); break; } case ConvergedMessage::Sending: @@ -470,7 +551,7 @@ // MsgConversationWidget::sendingState // @see header file //--------------------------------------------------------------- -int MsgConversationWidget::sendingState() +MsgConversationWidget::SendingState MsgConversationWidget::sendingState() { return mSendingState; } @@ -527,7 +608,15 @@ //--------------------------------------------------------------- void MsgConversationWidget::setTimeStamp(const QString &timeStamp) { + if(!mTimeStampTextItem) + { + mTimeStampTextItem = new HbTextItem(this); + } + HbStyle::setItemName(mTimeStampTextItem, "timeStamp"); + mTimeStampTextItem->setText(timeStamp); + mTimeStampTextItem->show(); + } //--------------------------------------------------------------- @@ -538,7 +627,6 @@ { if (mUnread) { - mNewFrameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); mNewFrameItem->frameDrawer().setFrameGraphicsName(NEW_ITEM_FRAME); } else @@ -610,4 +698,74 @@ } } + void MsgConversationWidget::resetProperties() + { + mHasAttachment = false; + mHasImage = false; + mHasAudio = false; + mHasVideo = false; + mIsPlayable =false; + mIncoming =false; + mUnread =false; + mIsMMS = false; + mIsMMSNotification= false; + mPriority = 0; + mSendingState =Unknown; + mNotificationState =0; + + if(mBodyTextItem){ + mBodyTextItem->setText(QString()); + mBodyTextItem->hide(); + HbStyle::setItemName(mBodyTextItem, ""); + } + + if(mSubjectTextItem){ + mSubjectTextItem->setText(QString()); + mSubjectTextItem->hide(); + HbStyle::setItemName(mSubjectTextItem, ""); + } + + if(mTimeStampTextItem){ + mTimeStampTextItem->setText(QString()); + mTimeStampTextItem->hide(); + HbStyle::setItemName(mTimeStampTextItem, ""); + } + + if(mAttachmentIconItem){ + mAttachmentIconItem->hide(); + HbStyle::setItemName(mAttachmentIconItem, ""); + } + + if(mPriorityIconItem){ + HbStyle::setItemName(mPriorityIconItem, ""); + mPriorityIconItem->hide(); + } + + if(mAudioIconItem){ + HbStyle::setItemName(mAudioIconItem, ""); + mAudioIconItem->hide(); + } + + if(mVideoIconItem){ + HbStyle::setItemName(mVideoIconItem, ""); + mVideoIconItem->hide(); + } + + if(mPlayIconItem){ + HbStyle::setItemName(mPlayIconItem, ""); + mPlayIconItem->hide(); + } + + if(mPreviewIconItem){ + HbStyle::setItemName(mPreviewIconItem, ""); + mPreviewIconItem->hide(); + } + } + + void MsgConversationWidget::repolishWidget() + { + QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); + repolish(); + } + // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/conversationview/src/msgeditorwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include "debugtraces.h" // LOCAL CONSTANTS -const QString PLUGINPATH("conversationviewplugin.dll"); const QString SEND_ICON("qtg_mono_send"); const QString BACKGROUND("qtg_fr_input_bg"); @@ -61,14 +61,6 @@ HbWidget(parent), mMsgEditor(NULL), mSendButton(NULL),mPluginLoader(NULL) { - int baseId = style()->registerPlugin(PLUGINPATH); - - #ifdef _DEBUG_TRACES_ - qDebug() << "MsgEditorWidget BASE ID --->" << baseId; - #endif - - setPluginBaseId(baseId); - //setting background. HbFrameItem* backGround = new HbFrameItem(this); backGround->frameDrawer().setFrameGraphicsName(BACKGROUND); @@ -133,7 +125,6 @@ //--------------------------------------------------------------- MsgEditorWidget::~MsgEditorWidget() { - style()->unregisterPlugin(PLUGINPATH); delete mEditorUtils; } @@ -229,7 +220,8 @@ //Check if sms segment limit has been reached bool unicode = (unicodeMode) ? true : false; int contentSize = mEditorUtils->UTF8Size(string); - int maxSmsSize = mEditorUtils->MaxSmsMsgSizeL(unicode); + int maxSmsSize = 0; + TRAP_IGNORE(maxSmsSize = mEditorUtils->MaxSmsMsgSizeL(unicode)); if(contentSize > maxSmsSize) { @@ -259,20 +251,11 @@ { mSmsCharLimitReached = false; - if(HbMessageBox::question(LOC_SMS_CHAR_LIMIT_REACHED, + HbMessageBox::question(LOC_SMS_CHAR_LIMIT_REACHED, + this,SLOT(onSmsCharLimitReached(HbAction*)), LOC_DIALOG_OK, - LOC_BUTTON_CANCEL)) - { - //Launch UniEditor - emit smsCharLimitReached(); - return; - } - else - { - //Set the previous content - setContent(QString(mPrevBuffer)); - return; - } + LOC_BUTTON_CANCEL); + } @@ -327,10 +310,10 @@ } //--------------------------------------------------------------- -// MsgEditor::setEncodingSettings +// MsgEditor::setEncodingSettingsL // @see header //--------------------------------------------------------------- -void MsgEditorWidget::setEncodingSettings() +void MsgEditorWidget::setEncodingSettingsL() { if( mPluginLoader ) { @@ -406,5 +389,22 @@ HbLineEdit::focusOutEvent(event); } +//--------------------------------------------------------------- +// MsgEditor::onSmsCharLimitReached +// @see header +//--------------------------------------------------------------- +void MsgEditorWidget::onSmsCharLimitReached(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + + //Launch UniEditor + emit smsCharLimitReached(); + } + else { + //Set the previous content + setContent( QString(mPrevBuffer)); + } +} // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/eabi/appengineu.def --- a/messagingapp/msgui/eabi/appengineu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/eabi/appengineu.def Fri May 14 15:49:35 2010 +0300 @@ -1,40 +1,41 @@ EXPORTS - _ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME - _ZN19ConversationsEngine11qt_metacastEPKc @ 2 NONAME - _ZN19ConversationsEngine13resendMessageEi @ 3 NONAME - _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 4 NONAME - _ZN19ConversationsEngine14getDraftsModelEv @ 5 NONAME - _ZN19ConversationsEngine15downloadMessageEi @ 6 NONAME - _ZN19ConversationsEngine16getConversationsEx @ 7 NONAME - _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 8 NONAME - _ZN19ConversationsEngine16staticMetaObjectE @ 9 NONAME DATA 16 - _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 10 NONAME - _ZN19ConversationsEngine18clearConversationsEv @ 11 NONAME - _ZN19ConversationsEngine19deleteConversationsEx @ 12 NONAME - _ZN19ConversationsEngine19getStaticMetaObjectEv @ 13 NONAME - _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 14 NONAME - _ZN19ConversationsEngine20markConversationReadEx @ 15 NONAME - _ZN19ConversationsEngine21getConversationsModelEv @ 16 NONAME - _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 17 NONAME - _ZN19ConversationsEngine22fetchMoreConversationsEv @ 18 NONAME - _ZN19ConversationsEngine24conversationModelUpdatedEv @ 19 NONAME - _ZN19ConversationsEngine24getCurrentConversationIdEv @ 20 NONAME - _ZN19ConversationsEngine26conversationModelPopulatedEv @ 21 NONAME - _ZN19ConversationsEngine26downloadOperationSupportedEi @ 22 NONAME - _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 23 NONAME - _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 24 NONAME - _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 25 NONAME - _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 26 NONAME - _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 27 NONAME - _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 28 NONAME - _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 29 NONAME - _ZN19ConversationsEngine8instanceEv @ 30 NONAME - _ZN19ConversationsEngineC1EP7QObject @ 31 NONAME - _ZN19ConversationsEngineC2EP7QObject @ 32 NONAME - _ZN19ConversationsEngineD0Ev @ 33 NONAME - _ZN19ConversationsEngineD1Ev @ 34 NONAME - _ZN19ConversationsEngineD2Ev @ 35 NONAME - _ZNK19ConversationsEngine10metaObjectEv @ 36 NONAME - _ZTI19ConversationsEngine @ 37 NONAME - _ZTV19ConversationsEngine @ 38 NONAME + _ZN19ConversationsEngine11getDBHandleERi @ 1 NONAME + _ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME + _ZN19ConversationsEngine11qt_metacastEPKc @ 3 NONAME + _ZN19ConversationsEngine13resendMessageEi @ 4 NONAME + _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 5 NONAME + _ZN19ConversationsEngine14getDraftsModelEv @ 6 NONAME + _ZN19ConversationsEngine15downloadMessageEi @ 7 NONAME + _ZN19ConversationsEngine16getConversationsEx @ 8 NONAME + _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 9 NONAME + _ZN19ConversationsEngine16staticMetaObjectE @ 10 NONAME DATA 16 + _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 11 NONAME + _ZN19ConversationsEngine18clearConversationsEv @ 12 NONAME + _ZN19ConversationsEngine19deleteConversationsEx @ 13 NONAME + _ZN19ConversationsEngine19getStaticMetaObjectEv @ 14 NONAME + _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 15 NONAME + _ZN19ConversationsEngine20markConversationReadEx @ 16 NONAME + _ZN19ConversationsEngine21getConversationsModelEv @ 17 NONAME + _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 18 NONAME + _ZN19ConversationsEngine22fetchMoreConversationsEv @ 19 NONAME + _ZN19ConversationsEngine24conversationModelUpdatedEv @ 20 NONAME + _ZN19ConversationsEngine24getCurrentConversationIdEv @ 21 NONAME + _ZN19ConversationsEngine26conversationModelPopulatedEv @ 22 NONAME + _ZN19ConversationsEngine26downloadOperationSupportedEi @ 23 NONAME + _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 24 NONAME + _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 25 NONAME + _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 26 NONAME + _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 27 NONAME + _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 28 NONAME + _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 29 NONAME + _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 30 NONAME + _ZN19ConversationsEngine8instanceEv @ 31 NONAME + _ZN19ConversationsEngineC1EP7QObject @ 32 NONAME + _ZN19ConversationsEngineC2EP7QObject @ 33 NONAME + _ZN19ConversationsEngineD0Ev @ 34 NONAME + _ZN19ConversationsEngineD1Ev @ 35 NONAME + _ZN19ConversationsEngineD2Ev @ 36 NONAME + _ZNK19ConversationsEngine10metaObjectEv @ 37 NONAME + _ZTI19ConversationsEngine @ 38 NONAME + _ZTV19ConversationsEngine @ 39 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/eabi/conversationviewu.def --- a/messagingapp/msgui/eabi/conversationviewu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/eabi/conversationviewu.def Fri May 14 15:49:35 2010 +0300 @@ -4,26 +4,29 @@ _ZN23MsgConversationBaseView11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME _ZN23MsgConversationBaseView11qt_metacastEPKc @ 4 NONAME _ZN23MsgConversationBaseView12clearContentEv @ 5 NONAME - _ZN23MsgConversationBaseView16openConversationEx @ 6 NONAME - _ZN23MsgConversationBaseView16staticMetaObjectE @ 7 NONAME DATA 16 - _ZN23MsgConversationBaseView18markMessagesAsReadEv @ 8 NONAME - _ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 9 NONAME - _ZN23MsgConversationBaseView19saveContentToDraftsEv @ 10 NONAME - _ZN23MsgConversationBaseView21closeConversationViewEv @ 11 NONAME - _ZN23MsgConversationBaseView21doDelayedConstructionEv @ 12 NONAME - _ZN23MsgConversationBaseView22conversationViewClosedEv @ 13 NONAME - _ZN23MsgConversationBaseView8handleOkERK8QVariant @ 14 NONAME - _ZN23MsgConversationBaseView8initViewEv @ 15 NONAME - _ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 16 NONAME - _ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 17 NONAME - _ZN23MsgConversationBaseViewD0Ev @ 18 NONAME - _ZN23MsgConversationBaseViewD1Ev @ 19 NONAME - _ZN23MsgConversationBaseViewD2Ev @ 20 NONAME - _ZNK23MsgConversationBaseView10metaObjectEv @ 21 NONAME - _ZTI23MsgConversationBaseView @ 22 NONAME - _ZTV23MsgConversationBaseView @ 23 NONAME - _ZThn16_N23MsgConversationBaseViewD0Ev @ 24 NONAME - _ZThn16_N23MsgConversationBaseViewD1Ev @ 25 NONAME - _ZThn8_N23MsgConversationBaseViewD0Ev @ 26 NONAME - _ZThn8_N23MsgConversationBaseViewD1Ev @ 27 NONAME + _ZN23MsgConversationBaseView14conversationIdEv @ 6 NONAME + _ZN23MsgConversationBaseView15handleViewReadyEv @ 7 NONAME + _ZN23MsgConversationBaseView16openConversationEx @ 8 NONAME + _ZN23MsgConversationBaseView16staticMetaObjectE @ 9 NONAME DATA 16 + _ZN23MsgConversationBaseView18markMessagesAsReadEv @ 10 NONAME + _ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 11 NONAME + _ZN23MsgConversationBaseView19saveContentToDraftsEv @ 12 NONAME + _ZN23MsgConversationBaseView21closeConversationViewEv @ 13 NONAME + _ZN23MsgConversationBaseView21doDelayedConstructionEv @ 14 NONAME + _ZN23MsgConversationBaseView22conversationViewClosedEv @ 15 NONAME + _ZN23MsgConversationBaseView8handleOkERK8QVariant @ 16 NONAME + _ZN23MsgConversationBaseView8initViewEv @ 17 NONAME + _ZN23MsgConversationBaseView9setPSCVIdEb @ 18 NONAME + _ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 19 NONAME + _ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 20 NONAME + _ZN23MsgConversationBaseViewD0Ev @ 21 NONAME + _ZN23MsgConversationBaseViewD1Ev @ 22 NONAME + _ZN23MsgConversationBaseViewD2Ev @ 23 NONAME + _ZNK23MsgConversationBaseView10metaObjectEv @ 24 NONAME + _ZTI23MsgConversationBaseView @ 25 NONAME + _ZTV23MsgConversationBaseView @ 26 NONAME + _ZThn16_N23MsgConversationBaseViewD0Ev @ 27 NONAME + _ZThn16_N23MsgConversationBaseViewD1Ev @ 28 NONAME + _ZThn8_N23MsgConversationBaseViewD0Ev @ 29 NONAME + _ZThn8_N23MsgConversationBaseViewD1Ev @ 30 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/eabi/msguiutilsu.def --- a/messagingapp/msgui/eabi/msguiutilsu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/eabi/msguiutilsu.def Fri May 14 15:49:35 2010 +0300 @@ -23,15 +23,23 @@ _ZN12MsgMediaUtilC2Ev @ 22 NONAME _ZN12MsgMediaUtilD1Ev @ 23 NONAME _ZN12MsgMediaUtilD2Ev @ 24 NONAME - _ZN19MmsConformanceCheck17launchEditorQueryEv @ 25 NONAME - _ZN19MmsConformanceCheck18checkModeForInsertERK7QStringb @ 26 NONAME - _ZN19MmsConformanceCheck21validateMsgForForwardEi @ 27 NONAME - _ZN19MmsConformanceCheck9showPopupERK7QString @ 28 NONAME - _ZN19MmsConformanceCheckC1Ev @ 29 NONAME - _ZN19MmsConformanceCheckC2Ev @ 30 NONAME - _ZN19MmsConformanceCheckD1Ev @ 31 NONAME - _ZN19MmsConformanceCheckD2Ev @ 32 NONAME - _ZNK11MsgSendUtil10metaObjectEv @ 33 NONAME - _ZTI11MsgSendUtil @ 34 NONAME - _ZTV11MsgSendUtil @ 35 NONAME + _ZN19MmsConformanceCheck11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME + _ZN19MmsConformanceCheck11qt_metacastEPKc @ 26 NONAME + _ZN19MmsConformanceCheck16staticMetaObjectE @ 27 NONAME DATA 16 + _ZN19MmsConformanceCheck18checkModeForInsertERK7QStringb @ 28 NONAME + _ZN19MmsConformanceCheck19getStaticMetaObjectEv @ 29 NONAME + _ZN19MmsConformanceCheck19onDialogInsertMediaEP8HbAction @ 30 NONAME + _ZN19MmsConformanceCheck21validateMsgForForwardEi @ 31 NONAME + _ZN19MmsConformanceCheck9showPopupERK7QString @ 32 NONAME + _ZN19MmsConformanceCheckC1Ev @ 33 NONAME + _ZN19MmsConformanceCheckC2Ev @ 34 NONAME + _ZN19MmsConformanceCheckD0Ev @ 35 NONAME + _ZN19MmsConformanceCheckD1Ev @ 36 NONAME + _ZN19MmsConformanceCheckD2Ev @ 37 NONAME + _ZNK11MsgSendUtil10metaObjectEv @ 38 NONAME + _ZNK19MmsConformanceCheck10metaObjectEv @ 39 NONAME + _ZTI11MsgSendUtil @ 40 NONAME + _ZTI19MmsConformanceCheck @ 41 NONAME + _ZTV11MsgSendUtil @ 42 NONAME + _ZTV19MmsConformanceCheck @ 43 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/eabi/unifiededitoru.def --- a/messagingapp/msgui/eabi/unifiededitoru.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/eabi/unifiededitoru.def Fri May 14 15:49:35 2010 +0300 @@ -9,9 +9,9 @@ _ZN20MsgUnifiedEditorView10addSubjectEv @ 8 NONAME _ZN20MsgUnifiedEditorView10addToolBarEv @ 9 NONAME _ZN20MsgUnifiedEditorView10fetchAudioEv @ 10 NONAME - _ZN20MsgUnifiedEditorView10pluginPathEv @ 11 NONAME + _ZN20MsgUnifiedEditorView10hideChromeEb @ 11 NONAME _ZN20MsgUnifiedEditorView11fetchImagesEv @ 12 NONAME - _ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessage @ 13 NONAME + _ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessageb @ 13 NONAME _ZN20MsgUnifiedEditorView11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME _ZN20MsgUnifiedEditorView11qt_metacastEPKc @ 15 NONAME _ZN20MsgUnifiedEditorView11resizeEventEP25QGraphicsSceneResizeEvent @ 16 NONAME @@ -27,31 +27,43 @@ _ZN20MsgUnifiedEditorView14sendingOptionsEv @ 26 NONAME _ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 27 NONAME _ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 28 NONAME - _ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 29 NONAME - _ZN20MsgUnifiedEditorView16staticMetaObjectE @ 30 NONAME DATA 16 - _ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 31 NONAME - _ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 32 NONAME - _ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 33 NONAME - _ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 34 NONAME - _ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 35 NONAME - _ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 36 NONAME - _ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 37 NONAME - _ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessage @ 38 NONAME - _ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 39 NONAME - _ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 40 NONAME - _ZN20MsgUnifiedEditorView4sendEv @ 41 NONAME - _ZN20MsgUnifiedEditorView7addMenuEv @ 42 NONAME - _ZN20MsgUnifiedEditorView8addCcBccEv @ 43 NONAME - _ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 44 NONAME - _ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 45 NONAME - _ZN20MsgUnifiedEditorViewD0Ev @ 46 NONAME - _ZN20MsgUnifiedEditorViewD1Ev @ 47 NONAME - _ZN20MsgUnifiedEditorViewD2Ev @ 48 NONAME - _ZNK20MsgUnifiedEditorView10metaObjectEv @ 49 NONAME - _ZTI20MsgUnifiedEditorView @ 50 NONAME - _ZTV20MsgUnifiedEditorView @ 51 NONAME - _ZThn16_N20MsgUnifiedEditorViewD0Ev @ 52 NONAME - _ZThn16_N20MsgUnifiedEditorViewD1Ev @ 53 NONAME - _ZThn8_N20MsgUnifiedEditorViewD0Ev @ 54 NONAME - _ZThn8_N20MsgUnifiedEditorViewD1Ev @ 55 NONAME + _ZN20MsgUnifiedEditorView16createTempFolderEv @ 29 NONAME + _ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 30 NONAME + _ZN20MsgUnifiedEditorView16onContentChangedEv @ 31 NONAME + _ZN20MsgUnifiedEditorView16removeTempFolderEv @ 32 NONAME + _ZN20MsgUnifiedEditorView16staticMetaObjectE @ 33 NONAME DATA 16 + _ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 34 NONAME + _ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 35 NONAME + _ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 36 NONAME + _ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 37 NONAME + _ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 38 NONAME + _ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 39 NONAME + _ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 40 NONAME + _ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 41 NONAME + _ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 42 NONAME + _ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 43 NONAME + _ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 44 NONAME + _ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 45 NONAME + _ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessage @ 46 NONAME + _ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 47 NONAME + _ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 48 NONAME + _ZN20MsgUnifiedEditorView4sendEv @ 49 NONAME + _ZN20MsgUnifiedEditorView7addMenuEv @ 50 NONAME + _ZN20MsgUnifiedEditorView8addCcBccEv @ 51 NONAME + _ZN20MsgUnifiedEditorView8initViewEv @ 52 NONAME + _ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 53 NONAME + _ZN20MsgUnifiedEditorView9vkbClosedEv @ 54 NONAME + _ZN20MsgUnifiedEditorView9vkbOpenedEv @ 55 NONAME + _ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 56 NONAME + _ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 57 NONAME + _ZN20MsgUnifiedEditorViewD0Ev @ 58 NONAME + _ZN20MsgUnifiedEditorViewD1Ev @ 59 NONAME + _ZN20MsgUnifiedEditorViewD2Ev @ 60 NONAME + _ZNK20MsgUnifiedEditorView10metaObjectEv @ 61 NONAME + _ZTI20MsgUnifiedEditorView @ 62 NONAME + _ZTV20MsgUnifiedEditorView @ 63 NONAME + _ZThn16_N20MsgUnifiedEditorViewD0Ev @ 64 NONAME + _ZThn16_N20MsgUnifiedEditorViewD1Ev @ 65 NONAME + _ZThn8_N20MsgUnifiedEditorViewD0Ev @ 66 NONAME + _ZThn8_N20MsgUnifiedEditorViewD1Ev @ 67 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/eabi/unifiedvieweru.def --- a/messagingapp/msgui/eabi/unifiedvieweru.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/eabi/unifiedvieweru.def Fri May 14 15:49:35 2010 +0300 @@ -2,7 +2,7 @@ _ZN13UnifiedViewer11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME _ZN13UnifiedViewer11qt_metacastEPKc @ 2 NONAME _ZN13UnifiedViewer11resizeEventEP25QGraphicsSceneResizeEvent @ 3 NONAME - _ZN13UnifiedViewer11sendMessageERK7QString @ 4 NONAME + _ZN13UnifiedViewer11sendMessageERK7QStringS2_ @ 4 NONAME _ZN13UnifiedViewer12clearContentEv @ 5 NONAME _ZN13UnifiedViewer13createToolBarEv @ 6 NONAME _ZN13UnifiedViewer15handleFwdActionEv @ 7 NONAME @@ -23,4 +23,5 @@ _ZThn16_N13UnifiedViewerD1Ev @ 22 NONAME _ZThn8_N13UnifiedViewerD0Ev @ 23 NONAME _ZThn8_N13UnifiedViewerD1Ev @ 24 NONAME + _ZN13UnifiedViewer17onDialogDeleteMsgEP8HbAction @ 25 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/conversationviewplugin.pro --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/conversationviewplugin.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +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: -# - -TEMPLATE = lib -TARGET = $$qtLibraryTarget(conversationviewplugin) - -TARGET.EPOCALLOWDLLDATA = 1 -TARGET.CAPABILITY = All -TCB -#UID 3 -TARGET.UID3 = 0x2001FE75 - -CONFIG += plugin hb -INCLUDEPATH += . inc ../../conversationview/inc ../../../../inc - -symbian:TARGET.EPOCALLOWDLLDATA = 1 -symbian:TARGET.CAPABILITY = CAP_GENERAL_DLL -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -# Input -HEADERS += inc/conversationviewplugin.h -SOURCES += src/conversationviewplugin.cpp - -RESOURCES += conversationviewplugin.qrc - -# The plugin stub is exported and its used in the sis or image creation -symbian { - BLD_INF_RULES.prj_exports += \ - "$${LITERAL_HASH}include " \ - "rom/conversationviewplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(conversationviewplugin.iby)" - } - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/conversationviewplugin.qrc --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/conversationviewplugin.qrc Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - resources/msgconversationwidget.css - resources/msgconversationwidget.widgetml - resources/msgconversationviewitem.css - resources/msgconversationviewitem.widgetml - resources/msgeditorwidget.css - resources/msgeditorwidget.widgetml - resources/msgcontactcardwidget.css - resources/msgcontactcardwidget.widgetml - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/inc/conversationviewplugin.h --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/inc/conversationviewplugin.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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: Layout plugin for all the widgets present in - * conversation view. - * - */ - -#ifndef CONVERSATIONVIEWPLUGIN_H -#define CONVERSATIONVIEWPLUGIN_H - -// INCLUDES -#include -#include -#include - -/** - * This class represents the conversationview layout plugin - * to define styling information for all the widgets present in - * the conversation view. - */ -class ConversationViewPlugin : public QObject, public HbStyleInterface -{ - Q_OBJECT Q_INTERFACES(HbStyleInterface) - -public: - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - int primitiveCount() const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QGraphicsItem *createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent = 0 ) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - void updatePrimitive( QGraphicsItem *item, HbStyle::Primitive primitive, const QStyleOption *option ) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QString layoutPath() const; - -}; - -#endif // CONVERSATIONVIEWPLUGIN_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.css --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ - -MsgContactCardWidget -{ - layout:layout-msg-mycard; - zvalue:3; -} - -MsgContactCardWidget::avatar -{ - left:-var(hb-param-margin-gene-left); - top:-1.0un; - bottom:1.0un; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-primary-large); - pref-height:var(hb-param-graphic-size-primary-large); -} - -MsgContactCardWidget::presence -{ - right:var(hb-param-margin-gene-right); - center-vertical:0un; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-secondary); - pref-hieght:var(hb-param-graphic-size-secondary); -} - -MsgContactCardWidget::addressText -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - center-vertical:0un; - text-height:var(hb-param-text-height-primary); - font-variant:primary; - text-line-count-min:1; - text-line-count-max:1; -} - -MsgContactCardWidget::backgroundFrame -{ - zvalue:-1; - left:0un; - top:0un; - right:0un; - bottom:0un; -} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.widgetml --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.css --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -MsgConversationViewItem[isIncoming="true"] -{ - layout:layout-incoming; - pref-height:-1; - pref-width:-1; - size-policy-vertical:minimum-expanding; -} - -MsgConversationViewItem[isIncoming="false"] -{ - layout:layout-outgoing; - pref-height:-1; - pref-width:-1; - size-policy-vertical:minimum-expanding; -} - -MsgConversationViewItem[isIncoming="true"]::msgconvwidget -{ - left:-var(hb-param-margin-gene-left); - top:0.0un; - right:var(hb-param-margin-gene-middle-horizontal); - bottom:0.0un; -} - -MsgConversationViewItem[isIncoming="true"]::msgStateIcon -{ - right:var(hb-param-margin-gene-right); - size-policy:fixed fixed; - aspect-ratio:ignore; - pref-height:var(hb-param-graphic-size-primary-small); - pref-width:var(hb-param-graphic-size-primary-small); -} - -MsgConversationViewItem[isIncoming="false"]::msgconvwidget -{ - top:0.0un; - right:var(hb-param-margin-gene-right); - bottom:0.0un; - left:-var(hb-param-margin-gene-middle-horizontal); -} - -MsgConversationViewItem[isIncoming="false"]::msgStateIcon -{ - left:-var(hb-param-margin-gene-left); - size-policy:fixed fixed; - aspect-ratio:ignore; - pref-height:var(hb-param-graphic-size-primary-small); - pref-width:var(hb-param-graphic-size-primary-small); -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.widgetml --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.css --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ - -/*********************************** LAYOUTS **********************************/ - -@variables -{ - bubble_width:expr(var(hb-param-screen-width)-var(hb-param-margin-gene-middle-horizontal)-var(hb-param-graphic-size-primary-small)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); - bubble_height:expr((3*var(bubble_width))/4); -} - -MsgConversationWidget[isMMS="false"] -{ - layout:layout-sms; -} - -MsgConversationWidget[isMMS="true"]:portrait -{ - layout:layout-mms-portrait; -} - -MsgConversationWidget[isMMS="true"][hasImage="true"]:landscape -{ - layout:layout-mms-image-landscape; -} - -MsgConversationWidget[isMMS="true"][hasImage="false"]:landscape -{ - layout:layout-mms-landscape; -} - -MsgConversationWidget[isMMS="true"][hasImage="false"][hasAudio="true"][hasVideo="false"]:portrait -{ - layout:layout-mms-audio-text-portrait; -} - -MsgConversationWidget[isMMS="true"][hasImage="false"][hasAudio="true"][hasVideo="false"]:landscape -{ - layout:layout-mms-audio-text-landscape; -} - -/********************* UNREAD INDICATOR / NEW ITEM ICON ************************/ - -MsgConversationWidget::newItemIcon -{ - left:-0.25un; - top:-1.0un; - bottom:1.0un; - size-policy:fixed preferred; - fixed-width:1.25un; -} - -/*********************************** BUBBLE ***********************************/ - -MsgConversationWidget::bubble -{ - left:0.0un; - top:0.0un; - right:0.0un; - bottom:0.0un; -} - -/********************************** BODYTEXT **********************************/ - -MsgConversationWidget::bodyText -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - right:1.0un; - bottom:var(hb-param-margin-gene-middle-vertical); - text-height:var(hb-param-text-height-secondary); - font-variant:primary; - text-align:left; - text-line-count-min:1; - text-line-count-max:100; -} - -MsgConversationWidget[isMMS="true"][hasImage="true"]::bodyText:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - -MsgConversationWidget[isMMS="true"][hasImage="false"][hasAudio="true"]::bodyText:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - -/********************************** SUBJECT ***********************************/ - -MsgConversationWidget[isMMS="true"]::subject -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-middle-vertical); - right:var(hb-param-margin-gene-middle-horizontal); - text-align:left; - text-height:var(hb-param-text-height-primary); - font-variant:primary; - text-line-count-max:1; - text-line-count-min:1; -} - -MsgConversationWidget[isMMS="true"][hasImage="true"]::subject:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - -MsgConversationWidget[isMMS="true"][hasImage="false"][hasAudio="true"]::subject:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - - -/******************************* ATTACHMENT ICON ******************************/ - -MsgConversationWidget[isMMS="true"]::attachment -{ - right:1.0un; - center-vertical:0.0un; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-secondary); - pref-height:var(hb-param-graphic-size-secondary); -} - -/********************************* PRIORITY ICON ******************************/ - -MsgConversationWidget[isMMS="true"]::priority -{ - right:0.5un; - center-vertical:0.0un; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-secondary); - pref-height:var(hb-param-graphic-size-secondary); -} - -/******************************** IMAGE / PREVIEW *****************************/ - -MsgConversationWidget[isMMS="true"][hasImage="true"]::preview:portrait -{ - left:-var(hb-param-margin-gene-left); - right:1.0un; - bottom:var(hb-param-margin-gene-middle-vertical); - aspect-ratio:keep; - /*max-width:var(bubble_width);*/ - max-width:41.36un; - max-height:31.02un; - /*max-height:var(bubble_height);*/ - min-width:16un; - min-height:12un; -} - -MsgConversationWidget[isMMS="true"][hasImage="true"]::preview:landscape -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-bottom); - aspect-ratio:keep; - max-width:41.36un; - max-height:31.02un; - min-width:16un; - min-height:12un; -} - -/****************************** TIMESTAMP TEXT ********************************/ - -MsgConversationWidget::timeStamp -{ - left:-var(hb-param-margin-gene-left); - right:1.0un; - bottom:var(hb-param-margin-gene-bottom); - text-align:left; - text-height:var(hb-param-text-height-tiny); - font-variant:primary; - text-line-count-max:1; - text-line-count-min:1; -} - -MsgConversationWidget[isMMS="true"][hasImage="true"]::timeStamp:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - -MsgConversationWidget[isMMS="true"][hasImage="false"][hasAudio="true"]::timeStamp:landscape -{ - left:-var(hb-param-margin-gene-middle-horizontal); -} - -/******************************* OVERLAY PLAY ICON ****************************/ - -MsgConversationWidget[isMMS="true"]::playIcon -{ - zvalue:1; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-primary-medium); - pref-height:var(hb-param-graphic-size-primary-medium); -} - -/******************************** AUDIO ICON **********************************/ - -MsgConversationWidget[isMMS="true"][hasAudio="true"]::audioIcon -{ - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - bottom:var(hb-param-margin-gene-middle-vertical); - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-primary-large); - pref-height:var(hb-param-graphic-size-primary-large); -} - -/* EOF */ \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.widgetml --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.css --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -MsgEditorWidget -{ - layout:layout-msg-editor; -} - -MsgEditorWidget::msgEditor -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-middle-vertical); - top:-var(hb-param-margin-gene-middle-vertical); - min-height:7.46un; -} - -MsgEditorWidget::sendButton -{ - top:-var(hb-param-margin-gene-middle-vertical); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-middle-vertical); - fixed-width: 9.34un; - fixed-height: 7.46un; -} - -MsgEditorWidget::charCounter -{ - size-policy:fixed fixed; - pref-height:-1; - pref-width:-1; - text-height:var(hb-param-text-height-tiny); -} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.widgetml --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/rom/conversationviewplugin.iby --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/rom/conversationviewplugin.iby Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 __CONVERSATIONVIEWPLUGIN_IBY__ -#define __CONVERSATIONVIEWPLUGIN_IBY__ - -REM DLL -file=ABI_DIR\UREL\conversationviewplugin.dll SHARED_LIB_DIR\conversationviewplugin.dll - -#endif // __CONVERSATIONVIEWPLUGIN_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/conversationviewplugin/src/conversationviewplugin.cpp --- a/messagingapp/msgui/layoutplugins/conversationviewplugin/src/conversationviewplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +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: Layout plugin for all the widgets present in - * conversation view. - * - */ - -#include "conversationviewplugin.h" - -// INCLUDES -#include -#include -#include -#include -#include -#include - -#include "debugtraces.h" - -// Constants -#define PRIMITIVECOUNT 1; - -//--------------------------------------------------------------- -// ConversationViewPlugin::primitiveCount -// @see header file -//--------------------------------------------------------------- -int ConversationViewPlugin::primitiveCount() const -{ -#ifdef _DEBUG_TRACES_ - qDebug() << "ConversationViewPlugin::primitiveCount"; -#endif - - - return PRIMITIVECOUNT; -} - -//--------------------------------------------------------------- -// ConversationViewPlugin::createPrimitive -// @see header file -//--------------------------------------------------------------- -QGraphicsItem* ConversationViewPlugin::createPrimitive( - HbStyle::Primitive primitive, QGraphicsItem *parent) const -{ - Q_UNUSED(primitive) - Q_UNUSED(parent) - return NULL; -} - -//--------------------------------------------------------------- -// ConversationViewPlugin::updatePrimitive -// @see header file -//--------------------------------------------------------------- -void ConversationViewPlugin::updatePrimitive(QGraphicsItem *item, - HbStyle::Primitive primitive, const QStyleOption *option) const -{ - Q_UNUSED(item) - Q_UNUSED(primitive) - Q_UNUSED(option) -} - -//--------------------------------------------------------------- -// ConversationViewPlugin::layoutPath -// @see header file -//--------------------------------------------------------------- -QString ConversationViewPlugin::layoutPath() const -{ - QString path; - - path = QString(":/"); - -#ifdef _DEBUG_TRACES_ - qDebug() << "layout plugin resources:" << path; -#endif - return path; -} - -Q_EXPORT_PLUGIN2(conversationviewplugin, ConversationViewPlugin) - -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/layoutplugins.pro --- a/messagingapp/msgui/layoutplugins/layoutplugins.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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: -# -# - -TEMPLATE = subdirs - -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -SUBDIRS += conversationviewplugin/conversationviewplugin.pro -SUBDIRS += unifiededitorplugin/unifiededitorplugin.pro diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/inc/msglistviewitemplugin.h --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/inc/msglistviewitemplugin.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +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 MSGLISTITEMVIEWPLUGIN_H -#define MSGLISTITEMVIEWPLUGIN_H - -// INCLUDES -#include -#include -#include - -class MsgListViewItemStyleOption; - -/** - * - */ -class MsgListViewItemPlugin : public QObject, public HbStyleInterface -{ - Q_OBJECT Q_INTERFACES(HbStyleInterface) - -public: - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - int primitiveCount() const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QGraphicsItem *createPrimitive(HbStyle::Primitive primitive, - QGraphicsItem *parent = 0) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - void updatePrimitive(QGraphicsItem *item, HbStyle::Primitive primitive, - const QStyleOption *option) const; - - /** - * Updates Presence Primitive - * @param item QGraphicsItem object - * @param primitive HbStyle::Primitive - * @param option MsgListViewItemStyleOption object - */ - void updatePresencePrimitive(QGraphicsItem *item, - HbStyle::Primitive primitive, - const MsgListViewItemStyleOption *option) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QString layoutPath() const; - -}; - -#endif // MSGLISTITEMVIEWPLUGIN_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/msglistviewitemplugin.pro --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/msglistviewitemplugin.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +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: -# - -TEMPLATE = lib -TARGET = $$qtLibraryTarget(msglistviewitemplugin) -CONFIG += plugin hb -INCLUDEPATH += . inc -INCLUDEPATH += ../../inc -INCLUDEPATH += ../../../../inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -symbian:TARGET.EPOCALLOWDLLDATA = 1 -symbian:TARGET.CAPABILITY = CAP_GENERAL_DLL -symbian:TARGET.UID3 = 0x2001FE72 - -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -# Build.inf rules -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ - "rom/msglistviewitemplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msglistviewitemplugin.iby)" - -# Input -HEADERS += inc/msglistviewitemplugin.h -SOURCES += src/msglistviewitemplugin.cpp - -RESOURCES += msglistviewitemplugin.qrc - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/msglistviewitemplugin.qrc --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/msglistviewitemplugin.qrc Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - resources/msglistviewitemwidget.css - resources/msglistviewitemwidget.widgetml - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/resources/msglistviewitemwidget.css --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/resources/msglistviewitemwidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -MsgListViewItemWidget:portrait { - layout: layout-portrait; -} - -MsgListViewItemWidget:landscape { - layout: layout-landscape; -} - -MsgListViewItemWidget::newMsgIndicator:portrait { - left:-var(hb-param-margin-view-left); - size-policy-horizontal: fixed; - size-policy-vertical: fixed; - pref-width: 1.25un; - pref-height: 15.1un; - aspect-ratio: ignore; -} - -MsgListViewItemWidget[unReadMsg="true"]::addressLabel:portrait { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-middle-vertical); - text-align: left; - font-variant: primary; - text-height:var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="false"]::addressLabel:portrait { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-middle-vertical); - text-align: left; - font-variant: secondary; - text-height:var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; - color: gray; -} - -MsgListViewItemWidget[unReadMsg="true"]::previewLabel:portrait { - left:-var(hb-param-margin-gene-middle-horizontal); - bottom:-var(hb-param-margin-gene-bottom); - right:var(hb-param-margin-gene-middle-horizontal); - text-align: left top; - font-variant: primary; - text-height: var(hb-param-text-height-secondary); - text-line-count-min:2; - text-line-count-max:2; -} - -MsgListViewItemWidget[unReadMsg="false"]::previewLabel:portrait { - left:-var(hb-param-margin-gene-middle-horizontal); - bottom:-var(hb-param-margin-gene-bottom); - right:var(hb-param-margin-gene-middle-horizontal); - text-align: left top; - font-variant: secondary; - text-height: var(hb-param-text-height-secondary); - text-line-count-min:2; - text-line-count-max:2; - color: gray; -} - -MsgListViewItemWidget::unreadCount:portrait { - right:var(hb-param-margin-gene-middle-horizontal); - size-policy-horizontal: fixed; - pref-width:6un; - text-align: left; - font-variant: primary; - text-height: var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="true"]::timeLabel:portrait { - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); - size-policy-horizontal: fixed; - pref-width:12un; - text-align: right; - font-variant: primary; - text-height: var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="false"]::timeLabel:portrait { - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); - size-policy-horizontal: fixed; - pref-width:12un; - text-align: right; - font-variant: secondary; - text-height: var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; - color: gray; -} - -MsgListViewItemWidget::presenceIndicator:portrait { - right: var(hb-param-margin-gene-right); - size-policy-horizontal: fixed; - size-policy-vertical: fixed; - pref-width: var(hb-param-graphic-size-secondary); - pref-height: var(hb-param-graphic-size-secondary); - aspect-ratio: ignore; -} - -/*Landscape mode*/ -MsgListViewItemWidget::newMsgIndicator:landscape { - left:-var(hb-param-margin-view-left); - size-policy-horizontal: fixed; - size-policy-vertical: ignore; - pref-width: 1.25un; - pref-height: -1; - aspect-ratio: ignore; -} - -MsgListViewItemWidget[unReadMsg="true"]::addressLabel:landscape { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-bottom); - text-align: left; - font-variant: primary; - text-height:var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="false"]::addressLabel:landscape { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-middle-horizontal); - bottom:var(hb-param-margin-gene-bottom); - text-align: left; - font-variant: secondary; - text-height:var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; - color:gray; -} - -MsgListViewItemWidget[unReadMsg="true"]::previewLabel:landscape { - right:var(hb-param-margin-gene-middle-horizontal); - text-align: left; - font-variant: primary; - text-height: var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="false"]::previewLabel:landscape { - right:var(hb-param-margin-gene-middle-horizontal); - text-align: left; - font-variant: secondary; - text-height: var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:1; - color:gray; -} - -MsgListViewItemWidget::unreadCount:landscape { - right:var(hb-param-margin-gene-middle-horizontal); - size-policy-horizontal: fixed; - pref-width:6un; - text-align: left; - font-variant: primary; - text-height: var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget::presenceIndicator:landscape { - right: var(hb-param-margin-gene-middle-horizontal); - size-policy-horizontal: fixed; - size-policy-vertical: fixed; - pref-width: var(hb-param-graphic-size-secondary); - pref-height: var(hb-param-graphic-size-secondary); - aspect-ratio: ignore; -} - -MsgListViewItemWidget[unReadMsg="true"]::timeLabel:landscape { - right:var(hb-param-margin-gene-right); - size-policy-horizontal: fixed; - pref-width:12un; - text-align: right; - font-variant: primary; - text-height: var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgListViewItemWidget[unReadMsg="false"]::timeLabel:landscape { - right:var(hb-param-margin-gene-right); - size-policy-horizontal: fixed; - pref-width:12un; - text-align: right; - font-variant: secondary; - text-height: var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; - color:gray; -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/resources/msglistviewitemwidget.widgetml --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/resources/msglistviewitemwidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/rom/msglistviewitemplugin.iby --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/rom/msglistviewitemplugin.iby Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 __MSGLISTVIEWITEMPLUGIN_IBY__ -#define __MSGLISTVIEWITEMPLUGIN_IBY__ - -REM DLL -file=ABI_DIR\UREL\msglistviewitemplugin.dll SHARED_LIB_DIR\msglistviewitemplugin.dll - -#endif // __MSGLISTVIEWITEMPLUGIN_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/msglistviewitemplugin/src/msglistviewitemplugin.cpp --- a/messagingapp/msgui/layoutplugins/msglistviewitemplugin/src/msglistviewitemplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +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: Layout plugin for all the widgets present in - * conversationlist view. - * - */ - -// INCLUDES -#include -#include -#include -#include -#include "debugtraces.h" -#include -#include -#include -#include - -// USER INCLUDES -#include "msglistviewitemplugin.h" - -// Frames -#define NEW_ITEM_FRAME ":/newitem/qtg_fr_list_new_item" -// Constants -#define PRIMITIVECOUNT 6; - -//--------------------------------------------------------------- -// MsgListViewItemPlugin::primitiveCount -// @see header file -//--------------------------------------------------------------- -int MsgListViewItemPlugin::primitiveCount() const -{ - return PRIMITIVECOUNT; -} - -//--------------------------------------------------------------- -// MsgListViewItemPlugin::createPrimitive -// @see header file -//--------------------------------------------------------------- -QGraphicsItem* MsgListViewItemPlugin::createPrimitive( - HbStyle::Primitive primitive, QGraphicsItem *parent) const -{ - Q_UNUSED(primitive); - Q_UNUSED(parent); -} - - - -//--------------------------------------------------------------- -// MsgListViewItemPlugin::updatePrimitive -// @see header file -//--------------------------------------------------------------- -void MsgListViewItemPlugin::updatePrimitive(QGraphicsItem *item, - HbStyle::Primitive primitive, const QStyleOption *option) const -{ - - Q_UNUSED(item); - - Q_UNUSED(primitive); - Q_UNUSED(option); -} - - - - - -//--------------------------------------------------------------- -// MsgListViewItemPlugin::layoutPath -// @see header file -//--------------------------------------------------------------- -QString MsgListViewItemPlugin::layoutPath() const -{ -#ifdef _DEBUG_TRACES_ - qDebug() << "MsgListViewItemPlugin::layoutPath"; -#endif - - QString path; - - path = QString(":/"); - -#ifdef _DEBUG_TRACES_ - qDebug() << "layout plugin resources:" << path; -#endif - - return path; -} - -Q_EXPORT_PLUGIN2(msglistviewitemplugin, MsgListViewItemPlugin) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/inc/unifiededitorplugin.h --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/inc/unifiededitorplugin.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +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 UNIFIEDEDITORPLUGIN_H -#define UNIFIEDEDITORPLUGIN_H - -// INCLUDES -#include -#include -#include - -/** - * TODO: add comment - */ -class UnifiedEditorPlugin : public QObject, public HbStyleInterface -{ - Q_OBJECT Q_INTERFACES(HbStyleInterface) - -public: - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - int primitiveCount() const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QGraphicsItem *createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent = 0 ) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - void updatePrimitive( QGraphicsItem *item, HbStyle::Primitive primitive, const QStyleOption *option ) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QString layoutPath() const; - -}; - -#endif // UNIFIEDEDITORPLUGIN_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.css --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} -MsgUnifiedEditorAddress { - layout:layout-default; -} - -MsgUnifiedEditorAddress::launchBtn { - right: var(hb-param-margin-gene-right); - fixed-width: 9.5un; - fixed-height: 7.46un; -} - -MsgUnifiedEditorAddress::addressField { - left: -var(hb-param-margin-gene-left); - right: var(hb-param-margin-gene-middle-horizontal); - min-height: 7.46un; - } - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.widgetml --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorattachment.css --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorattachment.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} - -MsgUnifiedEditorAttachment { - layout:layout-default; -} - -MsgUnifiedEditorAttachment::attachmentIcon -{ - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - bottom:var(hb-param-margin-gene-bottom); - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-primary-small); - pref-height:var(hb-param-graphic-size-primary-small); -} - -MsgUnifiedEditorAttachment::attachmentName -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - text-height:var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:1; -} - -MsgUnifiedEditorAttachment::attachmentDetails -{ - right:var(hb-param-margin-gene-right); - text-height:var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; - fixed-width: 13.0un; - text-align:right; -} - -MsgUnifiedEditorAttachment::bgFrame -{ - zvalue:-1; -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorattachment.widgetml --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorattachment.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.css --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} - -/********************************* LAYOUTS ***********************************/ -MsgUnifiedEditorBody:portrait { - layout: layout-portrait; -} - -MsgUnifiedEditorBody[hasImage="false"]:landscape { - layout: layout-landscape-no-image; -} - -MsgUnifiedEditorBody[hasImage="true"]:landscape { - layout: layout-landscape-image; -} - -/**************************** Text field margin ******************************/ -MsgUnifiedEditorBody::textEdit:portrait { - left: -var(hb-param-margin-gene-left); - right: var(hb-param-margin-gene-right); -} - -MsgUnifiedEditorBody[hasImage="true"][hasAudio="true"]::textEdit:portrait { - top: -var(hb-param-margin-gene-middle-vertical); -} - -MsgUnifiedEditorBody[hasImage="true"][hasAudio="false"]::textEdit:portrait { - top: -var(hb-param-margin-gene-middle-vertical); -} - -MsgUnifiedEditorBody[hasImage="false"][hasAudio="true"]::textEdit:portrait { - top: -var(hb-param-margin-gene-middle-vertical); -} - -MsgUnifiedEditorBody[hasImage="false"][hasAudio="false"]::textEdit:portrait { - top: 0.0un; -} - -MsgUnifiedEditorBody::textEdit:landscape { - right: var(hb-param-margin-gene-right); -} - -MsgUnifiedEditorBody[hasImage="true"]::textEdit:landscape { - left: -1.0un; -} - -MsgUnifiedEditorBody[hasImage="false"]::textEdit:landscape { - left: -var(hb-param-margin-gene-left); -} - -MsgUnifiedEditorBody[hasAudio="true"]::textEdit:landscape { - top: -var(hb-param-margin-gene-middle-vertical); -} - -MsgUnifiedEditorBody[hasAudio="false"]::textEdit:landscape { - top: 0.0un; -} - -/*************************** Image field margin ******************************/ -MsgUnifiedEditorBody::pixmap { - left: -var(hb-param-margin-gene-left); -} - -MsgUnifiedEditorBody::pixmap:portrait { - right: var(hb-param-margin-gene-right); -} - -MsgUnifiedEditorBody::pixmap:landscape { - right: 1.0un; -} - -MsgUnifiedEditorBody[hasAudio="true"]::pixmap { - top: -var(hb-param-margin-gene-middle-vertical); -} - -MsgUnifiedEditorBody[hasAudio="false"]::pixmap { - top: 0.0un; -} - -/*************************** Audio field margin ******************************/ - -MsgUnifiedEditorBody::audioItem { - left: -var(hb-param-margin-gene-left); - right: var(hb-param-margin-gene-right); -} - -/*************************** Character Counter ******************************/ -MsgUnifiedEditorBody::charCounter -{ - size-policy:fixed fixed; - pref-height:-1; - pref-width:-1; - text-height:var(hb-param-text-height-tiny); -} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.widgetml --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.css --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} - -MsgUnifiedEditorSubject { - layout:layout-default; -} - -MsgUnifiedEditorSubject::priorityIcon { - fixed-height: var(hb-param-graphic-size-secondary); - fixed-width: var(hb-param-graphic-size-secondary); - right: var(hb-param-margin-gene-right); - left: -0.5un; -} - -MsgUnifiedEditorSubject::subjectEdit { - left: -var(hb-param-margin-gene-left); - min-height:7.46un; - } - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.widgetml --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/rom/unifiededitorplugin.iby --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/rom/unifiededitorplugin.iby Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 __UNIFIEDEDITORPLUGIN_IBY__ -#define __UNIFIEDEDITORPLUGIN_IBY__ - -REM DLL -file=ABI_DIR\UREL\unifiededitorplugin.dll SHARED_LIB_DIR\unifiededitorplugin.dll - -#endif // __UNIFIEDEDITORPLUGIN_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/src/unifiededitorplugin.cpp --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/src/unifiededitorplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +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: - * - */ - -// INCLUDES -#include -#include "debugtraces.h" - -// USER INCLUDES -#include "unifiededitorplugin.h" - -//--------------------------------------------------------------- -// UnifiedEditorPlugin::primitiveCount -// @see header file -//--------------------------------------------------------------- -int UnifiedEditorPlugin::primitiveCount() const -{ - return 1; -} - -//--------------------------------------------------------------- -// UnifiedEditorPlugin::createPrimitive -// @see header file -//--------------------------------------------------------------- -QGraphicsItem* UnifiedEditorPlugin::createPrimitive( - HbStyle::Primitive primitive, QGraphicsItem *parent) const -{ - Q_UNUSED(primitive); - Q_UNUSED(parent); - return NULL; -} - -//--------------------------------------------------------------- -// UnifiedEditorPlugin::updatePrimitive -// @see header file -//--------------------------------------------------------------- -void UnifiedEditorPlugin::updatePrimitive(QGraphicsItem *item, - HbStyle::Primitive primitive, const QStyleOption *option) const -{ - Q_UNUSED(item); - Q_UNUSED(primitive); - Q_UNUSED(option); -} - -//--------------------------------------------------------------- -// UnifiedEditorPlugin::layoutPath -// @see header file -//--------------------------------------------------------------- -QString UnifiedEditorPlugin::layoutPath() const -{ -#ifdef _DEBUG_TRACES_ - qDebug() << "UnifiedEditorPlugin::layoutPath"; -#endif - - - QString path = QString(":/"); - -#ifdef _DEBUG_TRACES_ - qDebug() << "layout plugin resources:" << path; -#endif - - return path; -} - -Q_EXPORT_PLUGIN2(UnifiedEditorPlugin, UnifiedEditorPlugin) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/unifiededitorplugin.pro --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/unifiededitorplugin.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = $$qtLibraryTarget(unifiededitorplugin) -CONFIG += plugin -CONFIG += hb - -INCLUDEPATH += . inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -INCLUDEPATH += ../../../../inc - -symbian:TARGET.EPOCALLOWDLLDATA = 1 -symbian:TARGET.CAPABILITY = CAP_GENERAL_DLL -symbian:TARGET.UID3 = 0x2001FE63 - -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -# Build.inf rules -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ - "rom/unifiededitorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(unifiededitorplugin.iby)" - -# Input -HEADERS += inc/unifiededitorplugin.h -SOURCES += src/unifiededitorplugin.cpp - -RESOURCES += unifiededitorplugin.qrc - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiededitorplugin/unifiededitorplugin.qrc --- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/unifiededitorplugin.qrc Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - resources/msgunifiededitoraddress.widgetml - resources/msgunifiededitoraddress.css - resources/msgunifiededitorsubject.widgetml - resources/msgunifiededitorsubject.css - resources/msgunifiededitorattachment.widgetml - resources/msgunifiededitorattachment.css - resources/msgunifiededitorbody.css - resources/msgunifiededitorbody.widgetml - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/inc/unifiedviewerplugin.h --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/inc/unifiedviewerplugin.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef UNIFIEDVIEWERPLUGIN_H -#define UNIFIEDVIEWERPLUGIN_H - -// INCLUDES -#include -#include -#include - -/** - * TODO: add comment - */ -class UnifiedViewerPlugin : public QObject, public HbStyleInterface -{ -Q_OBJECT - Q_INTERFACES(HbStyleInterface) - -public: - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - int primitiveCount() const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QGraphicsItem *createPrimitive(HbStyle::Primitive primitive, - QGraphicsItem *parent = 0) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - void updatePrimitive(QGraphicsItem *item, HbStyle::Primitive primitive, - const QStyleOption *option) const; - - /** - * Inherited from HbStyleInterface - * @see HbStyleInterface docs - */ - QString layoutPath() const; - -}; - -#endif // UNIFIEDVIEWERPLUGIN_H -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univieweraddresswidget.css --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univieweraddresswidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -HbWidget -{ - margin-left: 0un; - margin-top: 0un; -} - -UniViewerAddressWidget -{ - layout: layout-default; -} - -UniViewerAddressWidget::addressField -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); - size-policy-vertical:fixed; -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univieweraddresswidget.widgetml --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univieweraddresswidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerbodywidget.css --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerbodywidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} - -UniViewerBodyWidget:portrait { - layout: layout-portrait; -} - -UniViewerBodyWidget:landscape[hasText="true"] { - layout: layout-landscape; -} - -UniViewerBodyWidget:landscape[hasText="false"] { - layout: layout-landscape-no-text; -} - -UniViewerBodyWidget::pixmap:portrait { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-right); - size-policy-vertical:fixed; - size-policy-horizontal:ignored; - pref-width:-1; -} - -UniViewerBodyWidget::textItem:portrait { - top:-var(hb-param-margin-gene-bottom); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-right); - text-height:var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:100; - text-align: left top; - font-variant:primary; - size-policy-vertical:minimum-expanding; - pref-height:-1; -} - -UniViewerBodyWidget::pixmap[hasText="true"]:landscape { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - size-policy-horizontal:fixed; - pref-height:-1; - size-policy-vertical:ignored; -} - -UniViewerBodyWidget::textItem:landscape { - top:-var(hb-param-margin-gene-top); - left:-2.0un; - right:var(hb-param-margin-gene-right); - text-height:var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:100; - text-align: left top; - font-variant:primary; - size-policy-vertical:minimum-expanding; - pref-height:-1; -} - -UniViewerBodyWidget::pixmap[hasText="false"]:landscape { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); - size-policy-horizontal:ignored; - pref-width:-1; - size-policy-vertical:fixed; -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerbodywidget.widgetml --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerbodywidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerdetailswidget.css --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerdetailswidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -HbWidget { - margin-left: 0un; - margin-top: 0un; -} - -UniViewerDetailsWidget { - layout:layout-default; -} - -UniViewerDetailsWidget::subjectLabel { - top:-var(hb-param-margin-gene-top); - left:-var(hb-param-margin-gene-left); - right:0.5un; - text-height:var(hb-param-text-height-primary); - text-line-count-min:1; - text-line-count-max:10; - text-align: left; - font-variant: primary; -} - -UniViewerDetailsWidget::timeLabel { - top:-var(hb-param-margin-gene-middle-vertical); - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); - text-height:var(hb-param-text-height-secondary); - text-line-count-min:1; - text-line-count-max:1; - text-align: left; - font-variant: primary; - } - -UniViewerDetailsWidget::priorityIcon { - right:var(hb-param-margin-gene-right); - center-vertical:0.0un; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-secondary); - pref-height:var(hb-param-graphic-size-secondary); -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerdetailswidget.widgetml --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/resources/univiewerdetailswidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/rom/unifiededitorplugin.iby --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/rom/unifiededitorplugin.iby Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 __UNIFIEDVIEWERPLUGIN_IBY__ -#define __UNIFIEDVIEWERPLUGIN_IBY__ - -REM DLL -file=ABI_DIR\UREL\unifiedviewerplugin.dll SHARED_LIB_DIR\unifiedviewerplugin.dll - -#endif // __UNIFIEDVIEWERPLUGIN_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/src/unifiedviewerplugin.cpp --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/src/unifiedviewerplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +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 "unifiedviewerplugin.h" - -// INCLUDES -#include -#include - -//--------------------------------------------------------------- -// UnifiedViewerPlugin::primitiveCount -// @see header file -//--------------------------------------------------------------- -int UnifiedViewerPlugin::primitiveCount() const -{ - // Return non zero count. - return 1; -} - -//--------------------------------------------------------------- -// UnifiedViewerPlugin::createPrimitive -// @see header file -//--------------------------------------------------------------- -QGraphicsItem* UnifiedViewerPlugin::createPrimitive( - HbStyle::Primitive primitive, QGraphicsItem *parent) const -{ - Q_UNUSED(primitive); - Q_UNUSED(parent); - return NULL; -} - -//--------------------------------------------------------------- -// UnifiedViewerPlugin::updatePrimitive -// @see header file -//--------------------------------------------------------------- -void UnifiedViewerPlugin::updatePrimitive(QGraphicsItem *item, - HbStyle::Primitive primitive, const QStyleOption *option) const -{ - Q_UNUSED(item); - Q_UNUSED(primitive); - Q_UNUSED(option); -} - -//--------------------------------------------------------------- -// UnifiedViewerPlugin::layoutPath -// @see header file -//--------------------------------------------------------------- -QString UnifiedViewerPlugin::layoutPath() const -{ - qDebug() << "UnifiedViewerPlugin::layoutPath"; - - QString path = QString(":/"); - - qDebug() << "layout plugin resources:" << path; - return path; -} - -Q_EXPORT_PLUGIN2(UnifiedViewerPlugin, UnifiedViewerPlugin) - -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/unifiedviewerplugin.pro --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/unifiedviewerplugin.pro Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +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: -# - -TEMPLATE = lib -TARGET = $$qtLibraryTarget(unifiedviewerplugin) -CONFIG += plugin -CONFIG += hb - -INCLUDEPATH += . inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -symbian:TARGET.EPOCALLOWDLLDATA = 1 -symbian:TARGET.CAPABILITY = CAP_GENERAL_DLL -symbian:TARGET.UID3 = 0x2001FE6F - -SYMBIAN_PLATFORMS = WINSCW ARMV5 - -# Build.inf rules -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ - "rom/unifiededitorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(unifiedviewerplugin.iby)" - -# Input -HEADERS += inc/unifiedviewerplugin.h -SOURCES += src/unifiedviewerplugin.cpp - -RESOURCES += unifiedviewerplugin.qrc - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/layoutplugins/unifiedviewerplugin/unifiedviewerplugin.qrc --- a/messagingapp/msgui/layoutplugins/unifiedviewerplugin/unifiedviewerplugin.qrc Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - resources/univieweraddresswidget.css - resources/univieweraddresswidget.widgetml - resources/univiewerbodywidget.css - resources/univiewerbodywidget.widgetml - resources/univiewerdetailswidget.css - resources/univiewerdetailswidget.widgetml - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/inc/draftslistview.h --- a/messagingapp/msgui/msgapp/inc/draftslistview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/inc/draftslistview.h Fri May 14 15:49:35 2010 +0300 @@ -26,7 +26,7 @@ class HbListWidget; class HbListWidgetItem; class HbAbstractViewItem; - +class HbAction; /** * List view implementation for showing Draft messages. */ @@ -113,6 +113,18 @@ */ void handleModelChanged(); + /** + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsg(HbAction* action); + + /** + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteAllMessages(HbAction* action); + private: /** @@ -140,6 +152,12 @@ { DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01 }; + + /** + * Flag to track if item has been long pressed. + * TODO: Remove it, once unique longpress and click event signal released in week16 + */ + bool mItemLongPressed; }; #endif /* DRAFTS_LISTVIEW_H */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/inc/msglistview.h --- a/messagingapp/msgui/msgapp/inc/msglistview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/inc/msglistview.h Fri May 14 15:49:35 2010 +0300 @@ -26,7 +26,7 @@ class HbAbstractViewItem; class HbListWidget; class HbListWidgetItem; - +class HbAction; /** * This class provides the message list view for the messaging application. * Data source for this view is the conversation list model. @@ -109,6 +109,12 @@ */ void contactInfo(); + /** + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsg(HbAction* action); + private: /** @@ -147,6 +153,11 @@ DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01 }; + /** + * Flag to track if item has been long pressed. + * TODO: Remove it, once unique longpress and click event signal released in week16 + */ + bool mItemLongPressed; }; #endif // MSG_LIST_VIEW_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/inc/msglistviewitem.h --- a/messagingapp/msgui/msgapp/inc/msglistviewitem.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/inc/msglistviewitem.h Fri May 14 15:49:35 2010 +0300 @@ -99,11 +99,6 @@ HbFrameItem* mNewMsgIndicatorItem; /** - * Background frame for item. - */ - HbFrameItem* mBgFrameItem; - - /** * To display address. * Owned */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/inc/msgserviceinterface.h --- a/messagingapp/msgui/msgapp/inc/msgserviceinterface.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/inc/msgserviceinterface.h Fri May 14 15:49:35 2010 +0300 @@ -22,18 +22,11 @@ // INCLUDES #include #include -#include //TODO: to be deprecated #include class ConvergedMessageAddress; -QTM_BEGIN_NAMESPACE -class QContactManager; -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - struct ContactDetail { public: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/inc/msgviewmanager.h --- a/messagingapp/msgui/msgapp/inc/msgviewmanager.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/inc/msgviewmanager.h Fri May 14 15:49:35 2010 +0300 @@ -31,6 +31,7 @@ class DraftsListView; class MsgSettingsView; class HbAction; +class HbView; class MsgViewManager: public QObject { @@ -152,7 +153,12 @@ * @param msgId message id */ void handleProvisoningMsg(int msgId); - + + /** + * Appends the views to be deleted into a QList to be deleted when view is ready + */ + void appendViewToBeDeleted(HbView* view); + private slots: /** * this slot is called on mainwindows back action. @@ -164,6 +170,28 @@ */ void switchView(const QVariantList& data); + /** + * This slot is called when viewReady signal is emitted from main window. + */ + void setViewInteractive(); + + /** + * Slot to delete previous view instances on view switch + */ + void deletePreviousView(); + + /** + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsg(HbAction* action); + + /** + * This slot is called when save tone dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogSaveTone(HbAction* action); + private: /** * main window reference not owned. @@ -187,6 +215,9 @@ bool mServiceRequest; qint64 mConversationId; bool mViewServiceRequest; + QList mViewTobeDeleted; + HbView* mDummyview; + int mMessageId; }; #endif /* MSGVIEWMANAGER_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/msgapp.pro --- a/messagingapp/msgui/msgapp/msgapp.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/msgapp.pro Fri May 14 15:49:35 2010 +0300 @@ -95,8 +95,4 @@ -lringbc \ -lunidatamodelloader -styleplugin.sources += conversationviewplugin.dll \ - unifiededitorplugin.dll \ - unifiedviewerplugin.dll -DEPLOYMENT += styleplugin diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/msgapp.qrc --- a/messagingapp/msgui/msgapp/msgapp.qrc Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/msgapp.qrc Fri May 14 15:49:35 2010 +0300 @@ -1,10 +1,13 @@ - - resources/xml/hblistviewitem.css - resources/xml/msglistviewitem.css - resources/xml/msglistviewitem.widgetml - resources/translations/messaging_en_GB + + resources/xml/msglistviewitem.css + resources/xml/msglistviewitem_color.css + resources/xml/msglistviewitem.widgetml + + + resources/xml/hblistviewitem.css + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/resources/xml/msglistviewitem.css --- a/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.css Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.css Fri May 14 15:49:35 2010 +0300 @@ -29,7 +29,6 @@ right:var(hb-param-margin-gene-middle-horizontal); bottom:var(hb-param-margin-gene-middle-vertical); text-align: left; - color: var(list_item_title_normal); font-variant: primary; text-height:var(hb-param-text-height-primary); text-line-count-min:1; @@ -42,7 +41,6 @@ right:var(hb-param-margin-gene-middle-horizontal); bottom:var(hb-param-margin-gene-middle-vertical); text-align: left; - color: var(list_item_title_normal); font-variant: secondary; text-height:var(hb-param-text-height-primary); text-line-count-min:1; @@ -54,7 +52,6 @@ bottom:-var(hb-param-margin-gene-bottom); right:var(hb-param-margin-gene-middle-horizontal); text-align: left top; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-secondary); text-line-count-min:2; @@ -66,7 +63,6 @@ bottom:-var(hb-param-margin-gene-bottom); right:var(hb-param-margin-gene-middle-horizontal); text-align: left top; - color: var(list_item_content_normal); font-variant: secondary; text-height: var(hb-param-text-height-secondary); text-line-count-min:2; @@ -77,7 +73,6 @@ right:var(hb-param-margin-gene-middle-horizontal); size-policy-horizontal: fixed; text-align: right; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-primary); text-line-count-min:1; @@ -90,7 +85,6 @@ size-policy-horizontal: fixed; pref-width:12un; text-align: right; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-tiny); text-line-count-min:1; @@ -103,7 +97,6 @@ size-policy-horizontal: fixed; pref-width:12un; text-align: right; - color: var(list_item_content_normal); font-variant: secondary; text-height: var(hb-param-text-height-tiny); text-line-count-min:1; @@ -135,7 +128,6 @@ right:var(hb-param-margin-gene-middle-horizontal); bottom:var(hb-param-margin-gene-bottom); text-align: left; - color: var(list_item_title_normal); font-variant: primary; text-height:var(hb-param-text-height-primary); text-line-count-min:1; @@ -148,7 +140,6 @@ right:var(hb-param-margin-gene-middle-horizontal); bottom:var(hb-param-margin-gene-bottom); text-align: left; - color: var(list_item_title_normal); font-variant: secondary; text-height:var(hb-param-text-height-primary); text-line-count-min:1; @@ -158,7 +149,6 @@ MsgListViewItem[unReadMsg="true"]::previewLabel[layoutName="custom"]:landscape { right:var(hb-param-margin-gene-middle-horizontal); text-align: left; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-secondary); text-line-count-min:1; @@ -168,7 +158,6 @@ MsgListViewItem[unReadMsg="false"]::previewLabel[layoutName="custom"]:landscape { right:var(hb-param-margin-gene-middle-horizontal); text-align: left; - color: var(list_item_content_normal); font-variant: secondary; text-height: var(hb-param-text-height-secondary); text-line-count-min:1; @@ -179,7 +168,6 @@ right:var(hb-param-margin-gene-middle-horizontal); size-policy-horizontal: fixed; text-align: right; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-primary); text-line-count-min:1; @@ -200,7 +188,6 @@ size-policy-horizontal: fixed; pref-width:12un; text-align: right; - color: var(list_item_content_normal); font-variant: primary; text-height: var(hb-param-text-height-tiny); text-line-count-min:1; @@ -212,7 +199,6 @@ size-policy-horizontal: fixed; pref-width:12un; text-align: right; - color: var(list_item_content_normal); font-variant: secondary; text-height: var(hb-param-text-height-tiny); text-line-count-min:1; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/resources/xml/msglistviewitem.widgetml --- a/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.widgetml Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.widgetml Fri May 14 15:49:35 2010 +0300 @@ -23,11 +23,6 @@ - - - - - @@ -54,11 +49,6 @@ - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/resources/xml/msglistviewitem_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem_color.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,33 @@ + +MsgListViewItem[unReadMsg="true"]::addressLabel { + color: var(qtc_list_item_title_normal); +} + +MsgListViewItem[unReadMsg="false"]::addressLabel { + color: var(qtc_list_item_content_normal); +} + +MsgListViewItem[unReadMsg="true"]::previewLabel { + color: var(qtc_list_item_title_normal); +} + +MsgListViewItem[unReadMsg="false"]::previewLabel { + color: var(qtc_list_item_content_normal); +} + +MsgListViewItem[unReadMsg="true"]::unreadCount { + color: var(qtc_list_item_title_normal); +} + +MsgListViewItem[unReadMsg="false"]::unreadCount { + color: var(qtc_list_item_content_normal); +} + +MsgListViewItem[unReadMsg="true"]::timeLabel { + color: var(qtc_list_item_title_normal); +} + +MsgListViewItem[unReadMsg="false"]::timeLabel { + color: var(qtc_list_item_content_normal); +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/rom/msgapp.iby --- a/messagingapp/msgui/msgapp/rom/msgapp.iby Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/rom/msgapp.iby Fri May 14 15:49:35 2010 +0300 @@ -23,7 +23,4 @@ data=DATAZ_\system\install\msgapp_stub.sis system\install\msgapp_stub.sis -data=\epoc32\data\z\private\2001fe79\conversationviewplugin.qtplugin \private\2001fe79\conversationviewplugin.qtplugin -data=\epoc32\data\z\private\2001fe79\unifiededitorplugin.qtplugin \private\2001fe79\unifiededitorplugin.qtplugin - #endif // __MSGAPP_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/draftslistview.cpp --- a/messagingapp/msgui/msgapp/src/draftslistview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/draftslistview.cpp Fri May 14 15:49:35 2010 +0300 @@ -43,7 +43,6 @@ #include "convergedmessageid.h" // LOCAL CONSTANTS -const QString LIST_ITEM_FRAME("qtg_fr_list_normal"); const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal"); const QString NEW_MESSAGE_ICON("qtg_mono_create_message"); const QString SORT_ICON("qtg_mono_sort"); @@ -75,7 +74,11 @@ // @see header //--------------------------------------------------------------- DraftsListView::DraftsListView(QGraphicsItem *parent) : - MsgBaseView(parent), mListView(0), mViewExtnList(0), mToolBar(0) + MsgBaseView(parent), + mListView(0), + mViewExtnList(0), + mToolBar(0), + mItemLongPressed(false) { // Delayed loading. connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedLoading())); @@ -163,7 +166,7 @@ mListView->setClampingStyle(HbScrollArea::BounceBackClamping); // Register the custorm css path. - HbStyleLoader::registerFilePath(":/xml/hblistviewitem.css"); + HbStyleLoader::registerFilePath(":/dlv"); // mListView->setLayoutName("custom"); // Set list item properties. @@ -171,8 +174,6 @@ prototype->setGraphicsSize(HbListViewItem::SmallIcon); prototype->setStretchingStyle(HbListViewItem::StretchLandscape); prototype->setSecondaryTextRowCount(1, 1); - HbFrameBackground frame(LIST_ITEM_FRAME, HbFrameDrawer::NinePieces); - prototype->setDefaultFrame(frame); // Create and set model QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this); @@ -229,14 +230,9 @@ return; } - bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - - if (result) { - int msgId = index.data(ConvergedMsgId).toInt(); - QList msgIdList; - msgIdList.append(msgId); - ConversationsEngine::instance()->deleteMessages(msgIdList); - } + HbMessageBox::question(LOC_DELETE_MESSAGE, + this,SLOT(onDialogDeleteMsg(HbAction*)), + LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); } @@ -246,12 +242,10 @@ //------------------------------------------------------------------------------ void DraftsListView::deleteAllDraftMessage() { - bool result = HbMessageBox::question(LOC_DELETE_ALL_DRAFTS, LOC_BUTTON_DELETE, + HbMessageBox::question(LOC_DELETE_ALL_DRAFTS, + this,SLOT(onDialogDeleteAllMessages(HbAction*)), + LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - - if (result) { - ConversationsEngine::instance()->deleteAllDraftMessages(); - } } //------------------------------------------------------------------------------ @@ -273,6 +267,12 @@ //------------------------------------------------------------------------------ void DraftsListView::openDraftMessage(const QModelIndex &index) { + if(mItemLongPressed) + { + //reset the flag + mItemLongPressed = false; + return; + } QVariant msgId = index.data(ConvergedMsgId); QVariant msgType = index.data(MessageType); ConvergedMessageId convergedMsgId = ConvergedMessageId(msgId.toInt()); @@ -299,13 +299,14 @@ //------------------------------------------------------------------------------ void DraftsListView::handleLongPressed(HbAbstractViewItem *item, const QPointF &coords) { + mItemLongPressed = true; if (this->isVisible()) { // Set the current index as tapped items index. mListView->setCurrentIndex(item->modelIndex(), QItemSelectionModel::Select); HbMenu *contextMenu = new HbMenu(); - + contextMenu->setAttribute(Qt::WA_DeleteOnClose); // Open HbAction* openAction = contextMenu->addAction(LOC_COMMON_OPEN); connect(openAction, SIGNAL(triggered()), this, SLOT(openDraftMessage())); @@ -314,8 +315,8 @@ HbAction *deletAction = contextMenu->addAction(LOC_COMMON_DELETE); connect(deletAction, SIGNAL(triggered()), this, SLOT(deleteDraftMessage())); - contextMenu->exec(coords); - delete contextMenu; + contextMenu->setPreferredPos(coords); + contextMenu->show(); } } @@ -353,4 +354,35 @@ } } +//------------------------------------------------------------------------------ +// DraftsListView::onDialogDeleteMsg +// @see header +//------------------------------------------------------------------------------ +void DraftsListView::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + QModelIndex index = mListView->currentIndex(); + if (index.isValid()) { + int msgId = index.data(ConvergedMsgId).toInt(); + QList msgIdList; + msgIdList.append(msgId); + ConversationsEngine::instance()->deleteMessages(msgIdList); + } + + } +} + +//------------------------------------------------------------------------------ +// DraftsListView::onDialogDeleteMsg +// @see header +//------------------------------------------------------------------------------ +void DraftsListView::onDialogDeleteAllMessages(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + ConversationsEngine::instance()->deleteAllDraftMessages(); + } +} + // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/msglistview.cpp --- a/messagingapp/msgui/msgapp/src/msglistview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/msglistview.cpp Fri May 14 15:49:35 2010 +0300 @@ -80,7 +80,8 @@ // @see header //--------------------------------------------------------------- MsgListView::MsgListView(QGraphicsItem *parent) : - MsgBaseView(parent) + MsgBaseView(parent), + mItemLongPressed(false) { connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); } @@ -100,6 +101,7 @@ //--------------------------------------------------------------- void MsgListView::longPressed(HbAbstractViewItem* viewItem, const QPointF& point) { + mItemLongPressed = true; if (this->isVisible()) { // Set the current index as the present Item's index. // By default it will not be set. @@ -107,7 +109,7 @@ // Create new menu HbMenu *contextMenu = new HbMenu(); - + contextMenu->setAttribute(Qt::WA_DeleteOnClose); //open menu option contextMenu->addAction(LOC_OPEN,this,SLOT(openConversation())); @@ -131,9 +133,8 @@ //delete conversation contextMenu->addAction(LOC_DELETE_CONVERSATION,this,SLOT(deleteItem())); - contextMenu->exec(point); - // Cleanup - delete contextMenu; + contextMenu->setPreferredPos(point); + contextMenu->show(); } } @@ -143,6 +144,11 @@ //--------------------------------------------------------------- void MsgListView::openConversation(const QModelIndex& index) { + if(mItemLongPressed) + { + mItemLongPressed = false; + return; + } //TODO: model populating possibilities. if (index.isValid()) { QVariant conversationId = index.data(ConversationId); @@ -211,18 +217,10 @@ #ifdef _DEBUG_TRACES_ qDebug() << "Inside MsgListView::deleteItem"; #endif - - QModelIndex index = mMsgList->currentIndex(); - qint64 conversationId = index.data(ConversationId).toLongLong(); - //confirmation dialog. - bool result = HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION, - LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - if (result) - { - ConversationsEngine::instance()->deleteConversations(conversationId); - } - + HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION, + this,SLOT(onDialogDeleteMsg(HbAction*)), + LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); #ifdef _DEBUG_TRACES_ qDebug() << " Leaving MsgConversationView::deleteItem"; #endif @@ -244,8 +242,7 @@ viewHeading->setHeading(LOC_VIEW_HEADING); // Register the custorm css path. - HbStyleLoader::registerFilePath(":/xml/msglistviewitem.css"); - HbStyleLoader::registerFilePath(":/xml/msglistviewitem.widgetml"); + HbStyleLoader::registerFilePath(":/clv"); mMsgList = new HbListView(this); mMsgList->setScrollingStyle(HbScrollArea::PanOrFlick); @@ -423,4 +420,22 @@ delete request; } +//--------------------------------------------------------------- +// MsgListView::onDialogDeleteMsg +// @see header +//--------------------------------------------------------------- +void MsgListView::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + QModelIndex index = mMsgList->currentIndex(); + if(index.isValid()) + { + qint64 conversationId = index.data(ConversationId).toLongLong(); + ConversationsEngine::instance()->deleteConversations(conversationId); + } + + } +} + //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/msglistviewitem.cpp --- a/messagingapp/msgui/msgapp/src/msglistviewitem.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/msglistviewitem.cpp Fri May 14 15:49:35 2010 +0300 @@ -43,7 +43,6 @@ #define LOC_RECEIVED_FILES hbTrId("txt_messaging_list_received_files") const QString NEW_ITEM_FRAME("qtg_fr_list_new_item"); -const QString LIST_ITEM_BG_FRAME("qtg_fr_list_normal"); const QString BT_ICON("qtg_large_bluetooth"); const QString MSG_OUTGOING_ICON("qtg_mono_outbox"); const QString MSG_FAILED_ICON("qtg_mono_failed"); @@ -56,7 +55,6 @@ HbListViewItem(parent), mUnReadMsg(false), mNewMsgIndicatorItem(NULL), - mBgFrameItem(NULL), mAddressLabelItem(NULL), mTimestampItem(NULL), mPreviewLabelItem(NULL), @@ -109,15 +107,6 @@ mNewMsgIndicatorItem->frameDrawer().setFrameType( HbFrameDrawer::ThreePiecesVertical); } - if (!mBgFrameItem) - { - mBgFrameItem = new HbFrameItem(this); - mBgFrameItem->setZValue(-1.0); - HbStyle::setItemName(mBgFrameItem, "bgFrame"); - - mBgFrameItem->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME); - mBgFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - } // Set the message text depending upon the message type int messageType = modelIndex().data(MessageType).toInt(); @@ -194,6 +183,9 @@ previewText.append(QChar::LineSeparator); previewText.append(bodyText); } + else if (msgSubType == ConvergedMessage::Provisioning) { + previewText = bodyText; + } else { previewText = LOC_UNSUPPORTED_MSG_TYPE; } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/msgmainwindow.cpp --- a/messagingapp/msgui/msgapp/src/msgmainwindow.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/msgmainwindow.cpp Fri May 14 15:49:35 2010 +0300 @@ -31,7 +31,6 @@ MsgMainWindow::MsgMainWindow(bool serviceRequest, QWidget *parent) : HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0) { - hideItems(Hb::NaviPaneItem); MsgViewManager* viewManager = new MsgViewManager(serviceRequest,this,this); mMsgSI = new MsgServiceInterface(NULL,viewManager); mMsgSendSI = new MsgSendServiceInterface(NULL,viewManager); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/msgserviceinterface.cpp --- a/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp Fri May 14 15:49:35 2010 +0300 @@ -17,15 +17,11 @@ */ //TODO: to be deprecated -#include -#include "qcontactdetailfilter.h" -#include "qcontactdetail.h" -#include "qtcontacts.h" #include "convergedmessageaddress.h" #include "msgserviceinterface.h" #include "msgviewmanager.h" -//INCLUDES +#include "msgcontacthandler.h" MsgServiceInterface::MsgServiceInterface(QObject* parent, MsgViewManager* manager) :XQServiceProvider( QLatin1String("com.nokia.services.hbserviceprovider.conversationview"),parent), @@ -90,28 +86,20 @@ mViewManager->openEditor(number,resolvedName); } -bool MsgServiceInterface::resolveContact(const ConvergedMessageAddress &address, - ContactDetail &contactDetail) - { - QContactManager* mPhonebookManager = new QContactManager("symbian"); - QContactDetailFilter phoneFilter; - phoneFilter.setDetailDefinitionName( - QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); - phoneFilter.setValue(address.address()); - phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); +bool MsgServiceInterface::resolveContact( + const ConvergedMessageAddress &address, + ContactDetail &contactDetail) +{ + QString displayLabel = QString(""); + int localId = + MsgContactHandler::resolveContactDisplayName(address.address(), + displayLabel, + 0); - QList sortOrder; - QList matchingContacts = mPhonebookManager->contacts( - phoneFilter, - sortOrder, - QStringList()); - - if ( matchingContacts.count() > 0 ) { - // Fill the contact details - QContact match = matchingContacts.at(0); - contactDetail.contactId = match.localId(); - contactDetail.displayName = match.displayLabel(); + if (localId != -1) + { + contactDetail.contactId = localId; + contactDetail.displayName = displayLabel; return true; } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgapp/src/msgviewmanager.cpp --- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Fri May 14 15:49:35 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include #include "conversationsengine.h" #include "msglistview.h" @@ -43,16 +44,18 @@ #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete") #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") +#define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") +#define LOC_COMMON_SAVE hbTrId("txt_common_menu_save") const qint64 NULL_CONVERSATIONID = -1; MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent) : QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0), mUniViewer(0), mDraftsListView(0), mSettingsView(0), mBackAction(0), mServiceRequest( - serviceRequest), mConversationId(-1), mViewServiceRequest(false) + serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1) { //creating back action. - mBackAction = new HbAction(Hb::BackAction, this); + mBackAction = new HbAction(Hb::BackNaviAction, this); connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); //create clv as first view if not a service request. @@ -62,6 +65,13 @@ param << MsgBaseView::CLV; switchView(param); } + else + { + mDummyview = new HbView(); + mMainWindow->addView(mDummyview); + mMainWindow->setCurrentView(mDummyview); + mViewTobeDeleted << mDummyview; + } } MsgViewManager::~MsgViewManager() @@ -98,6 +108,9 @@ //marking messages as red in CV. mConversationView->markMessagesAsRead(); + // reset the conversation id published + mConversationView->setPSCVId(false); + //clearing content of cv. mConversationView->clearContent(); @@ -150,14 +163,6 @@ break; } - //Now UE can be launched from viewer and on its back - //we need to clear viewer - if (mUniViewer) { - mMainWindow->removeView(mUniViewer); - delete mUniViewer; - mUniViewer = NULL; - } - //switch to clv. if (mServiceRequest) { completeServiceRequest(); @@ -186,8 +191,6 @@ param << mConversationId; switchView(param); - delete mUniViewer; - mUniViewer = NULL; } break; } @@ -208,7 +211,12 @@ void MsgViewManager::switchView(const QVariantList& data) { + + connect(mMainWindow, SIGNAL(viewReady()),this,SLOT(setViewInteractive())); + mMainWindow->setInteractive(false); + int viewId = data.at(0).toInt(); + switch (viewId) { case MsgBaseView::DEFAULT: { @@ -217,15 +225,16 @@ } case MsgBaseView::CLV: { - switchToClv(data); - break; - } + switchToClv(data); + break; + } - case MsgBaseView::CV: - { - switchToCv(data); - break; - } + case MsgBaseView::CV: + { + + switchToCv(data); + break; + } case MsgBaseView::DLV: { @@ -253,6 +262,18 @@ } } +void MsgViewManager::deletePreviousView() +{ + while(mViewTobeDeleted.count()) + { + HbView* v = mViewTobeDeleted.takeAt(0); + mMainWindow->removeView(v); + delete v; + } + disconnect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deletePreviousView())); +} + + void MsgViewManager::send(const qint32 contactId, const QString phoneNumber, const QString displayName) { @@ -348,6 +369,11 @@ if (conversationId < 0) { param << MsgBaseView::CLV; param << MsgBaseView::SERVICE; + + if( mCurrentView == MsgBaseView::CV && mConversationView) + { + mConversationView->setPSCVId(false); + } } else { param << MsgBaseView::CV; @@ -433,13 +459,8 @@ HbApplication::quit(); } - //remove the settings view from main window - if (mSettingsView) { - mMainWindow->removeView(mSettingsView); - mSettingsView->setNavigationAction(mBackAction); - connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction()), Qt::UniqueConnection); - } if (mConversationView) { + mConversationView->saveContentToDrafts(); //clearing content of cv. mConversationView->clearContent(); } @@ -452,20 +473,21 @@ mMainWindow->addView(mListView); } - //delete uni editor. - if (mUniEditor) { - mMainWindow->removeView(mUniEditor); - delete mUniEditor; + mMainWindow->setCurrentView(mListView); + + //delete UniEditor + if (mUniEditor) + { + appendViewToBeDeleted(mUniEditor); mUniEditor = NULL; } - - if (mUniViewer) { - mMainWindow->removeView(mUniViewer); - delete mUniViewer; + + //delete UniViewer + if (mUniViewer) + { + appendViewToBeDeleted(mUniViewer); mUniViewer = NULL; } - - mMainWindow->setCurrentView(mListView); } void MsgViewManager::switchToCv(const QVariantList& data) @@ -480,19 +502,6 @@ HbApplication::quit(); } - //delete uni editor. - if (mUniEditor) { - mMainWindow->removeView(mUniEditor); - delete mUniEditor; - mUniEditor = NULL; - } - - if (mUniViewer) { - mMainWindow->removeView(mUniViewer); - delete mUniViewer; - mUniViewer = NULL; - } - QVariant var = data.at(2); qint64 conversationId; if (var.type() == QVariant::String) { @@ -503,6 +512,11 @@ QVariantList param; param << MsgBaseView::CLV; param << MsgBaseView::CV; + + if( mCurrentView == MsgBaseView::CV && mConversationView){ + mConversationView->setPSCVId(false); + } + switchView(param); return; } @@ -512,9 +526,15 @@ // Unified viewer set curent view as conversation view // and return mMainWindow->setCurrentView(mConversationView); - - delete mUniViewer; - mUniViewer = NULL; + + // publish already opened conversation's id + mConversationView->setPSCVId(true); + + if (mUniViewer) + { + appendViewToBeDeleted(mUniViewer); + mUniViewer = NULL; + } return; } @@ -532,6 +552,12 @@ mMainWindow->addView(mConversationView); } + else if (mConversationView->conversationId() != mConversationId){ + //Save content to drafts before switching to different CV + mConversationView->saveContentToDrafts(); + //clearing content of current cv. + mConversationView->clearContent(); + } mConversationView->openConversation(conversationId); @@ -541,6 +567,20 @@ else { mMainWindow->setCurrentView(mConversationView); } + + //delete UniEditor + if (mUniEditor) + { + appendViewToBeDeleted(mUniEditor); + mUniEditor = NULL; + } + + //delete UniViewer + if (mUniViewer) + { + appendViewToBeDeleted(mUniViewer); + mUniViewer = NULL; + } } void MsgViewManager::switchToDlv(const QVariantList& data) @@ -549,13 +589,6 @@ mCurrentView = MsgBaseView::DLV; mPreviousView = data.at(1).toInt(); - //delete uni editor. - if (mUniEditor) { - mMainWindow->removeView(mUniEditor); - delete mUniEditor; - mUniEditor = NULL; - } - if (!mDraftsListView) { mDraftsListView = new DraftsListView(); mDraftsListView->setNavigationAction(mBackAction); @@ -585,6 +618,12 @@ mConversationView->clearContent(); } + // reset conversation id published + if(mPreviousView == MsgBaseView::CV && mConversationView) + { + mConversationView->setPSCVId(false); + } + //swich to unieditor. if (!mUniEditor) { mUniEditor = new MsgUnifiedEditorView(); @@ -616,6 +655,12 @@ else { mMainWindow->setCurrentView(mUniEditor); } + //delete UniViewer + if (mUniViewer ) + { + appendViewToBeDeleted(mUniViewer); + mUniViewer = NULL; + } } void MsgViewManager::switchToUniViewer(const QVariantList& data) @@ -651,6 +696,12 @@ mUniViewer->populateContent(messageId, true, msgCount); delete message; } + + if(mPreviousView==MsgBaseView::CV && mConversationView) + { + mConversationView->setPSCVId(false); + } + mMainWindow->setCurrentView(mUniViewer); } void MsgViewManager::switchToMsgSettings(const QVariantList& data) @@ -659,11 +710,22 @@ mPreviousView = data.at(1).toInt(); if (!mSettingsView) { - mSettingsView = new MsgSettingsView(); + + MsgSettingsView::SettingsView view = MsgSettingsView::DefaultView; + if (mPreviousView == MsgBaseView::UNIEDITOR || mPreviousView + == MsgBaseView::CV) + { + view = (MsgSettingsView::SettingsView)data.at(2).toInt(); + } + + mSettingsView = new MsgSettingsView(view); mSettingsView->setNavigationAction(mBackAction); mMainWindow->addView(mSettingsView); mMainWindow->setCurrentView(mSettingsView); } + if(mPreviousView==MsgBaseView::CV && mConversationView){ + mConversationView->setPSCVId(false); + } } void MsgViewManager::handleDefault(const QVariantList& data) @@ -675,9 +737,9 @@ mCurrentView = mPreviousView; mPreviousView = previousViewId; //remove the settings view from main window - if (mSettingsView) { - mMainWindow->removeView(mSettingsView); - delete mSettingsView; + if (mSettingsView) + { + appendViewToBeDeleted(mSettingsView); mSettingsView = NULL; } switch (mCurrentView) { @@ -717,7 +779,7 @@ { int msgType; int msgSubType; - + mMessageId = msgId; qint32 messageId(msgId); ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType); @@ -747,14 +809,9 @@ default: { // for un supported message show delete option - bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, LOC_BUTTON_DELETE, + HbMessageBox::question(LOC_DELETE_MESSAGE,this,SLOT(onDialogDeleteMsg(HbAction*)), + LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - if (result) { - QList msgIdList; - msgIdList << msgId; - ConversationsEngine::instance()->deleteMessages(msgIdList); - } - HbApplication::quit(); // exit after handling break; } } @@ -788,29 +845,9 @@ // ---------------------------------------------------------------------------- void MsgViewManager::handleRingtoneMsg(int msgId) { - if (RingBc::askSaveQuery()) { - UniDataModelLoader* pluginLoader = new UniDataModelLoader(); - UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin( - ConvergedMessage::BioMsg); - pluginInterface->setMessageId(msgId); - UniMessageInfoList attachments = pluginInterface->attachmentList(); - - QString attachmentPath = attachments.at(0)->path(); - - RingBc* ringBc = new RingBc(); - ringBc->saveTone(attachmentPath); - - // clear attachement list : its allocated at data model - while (!attachments.isEmpty()) { - delete attachments.takeFirst(); - } - - delete ringBc; - delete pluginLoader; - } - - // close the application once its handled - HbApplication::quit(); + mMessageId = msgId; + HbMessageBox::question(LOC_DIALOG_SAVE_RINGTONE, this, + SLOT(onDialogSaveTone(HbAction*)), LOC_COMMON_SAVE, LOC_BUTTON_CANCEL); } // ---------------------------------------------------------------------------- @@ -844,3 +881,70 @@ // close the application once its handled HbApplication::quit(); } + +void MsgViewManager::setViewInteractive() +{ + if(!mMainWindow->isInteractive()) + { + mMainWindow->setInteractive(true); + } + + disconnect(mMainWindow, SIGNAL(viewReady()),this,SLOT(setViewInteractive())); +} + +void MsgViewManager::appendViewToBeDeleted(HbView* view) +{ + if (view) + { + mViewTobeDeleted << view; + connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deletePreviousView())); + } +} + +// ---------------------------------------------------------------------------- +// MsgViewManager::onDialogDeleteMsg +// @see header +// ---------------------------------------------------------------------------- +void MsgViewManager::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + QList msgIdList; + msgIdList << mMessageId; + ConversationsEngine::instance()->deleteMessages(msgIdList); + } + HbApplication::quit(); // exit after handling +} + +// ---------------------------------------------------------------------------- +// MsgViewManager::onDialogSaveTone +// @see header +// ---------------------------------------------------------------------------- +void MsgViewManager::onDialogSaveTone(HbAction* action) + { + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + UniDataModelLoader* pluginLoader = new UniDataModelLoader(); + UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin( + ConvergedMessage::BioMsg); + pluginInterface->setMessageId(mMessageId); + UniMessageInfoList attachments = pluginInterface->attachmentList(); + + QString attachmentPath = attachments.at(0)->path(); + + RingBc* ringBc = new RingBc(); + ringBc->saveTone(attachmentPath); + + // clear attachement list : its allocated at data model + while (!attachments.isEmpty()) { + delete attachments.takeFirst(); + } + + delete ringBc; + delete pluginLoader; + } + + // close the application once its handled + HbApplication::quit(); +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msgui.pro --- a/messagingapp/msgui/msgui.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msgui.pro Fri May 14 15:49:35 2010 +0300 @@ -19,7 +19,6 @@ SYMBIAN_PLATFORMS = WINSCW ARMV5 # DLLs -SUBDIRS += layoutplugins/layoutplugins.pro SUBDIRS += msguiutils/msguiutils.pro SUBDIRS += appengine/appengine.pro SUBDIRS += conversationview/conversationview.pro diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h --- a/messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h Fri May 14 15:49:35 2010 +0300 @@ -18,6 +18,8 @@ #ifndef MMS_CONFORMANCE_CHECK_OPERATION_H #define MMS_CONFORMANCE_CHECK_OPERATION_H +#include + #include #include @@ -30,7 +32,7 @@ class CMmsConformance; class CMsgMediaResolver; class CDRMHelper; - +class HbAction; enum MmsConformanceCheckErrors { @@ -44,8 +46,10 @@ * */ -class MSGUI_UTILS_DLL_EXPORT MmsConformanceCheck +class MSGUI_UTILS_DLL_EXPORT MmsConformanceCheck : public QObject { + Q_OBJECT + public: /** @@ -79,15 +83,17 @@ private: /* - * Launch query dialog - */ - bool launchEditorQuery(); - - /* * Launch notification dialog */ void showPopup(const QString& text); +private slots: + + /** + * This slot is called when insert media dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogInsertMedia(HbAction* action); private: /* @@ -99,6 +105,11 @@ * Max MMS composition size */ int iMaxMmsSize; + + /** + * Conformance status + */ + TUint32 iConfStatus; }; #endif //MMS_CONFORMANCE_CHECK_OPERATION_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp --- a/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Fri May 14 15:49:35 2010 +0300 @@ -29,6 +29,7 @@ #include #include #include +#include #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" @@ -107,7 +108,7 @@ mediaResolver->ParseInfoDetailsL(info,fileHandle); TMmsConformance conformance = mmsConformance->MediaConformance(*info); - TUint32 confStatus = conformance.iConfStatus; + iConfStatus = conformance.iConfStatus; CleanupStack::PopAndDestroy(4); @@ -121,22 +122,19 @@ | EMmsConfNokTooBig); // If user answers yes to Guided mode confirmation query he/she moves to free mode - if ( (confStatus & i) && ! (confStatus & j)) + if ( (iConfStatus & i) && ! (iConfStatus & j)) { if (iCreationMode == EMmsCreationModeFree || info->Protection() & EFileProtSuperDistributable) { // SuperDistribution not checked here // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode - confStatus &= ~EMmsConfNokFreeModeOnly; - confStatus &= ~EMmsConfNokScalingNeeded; + iConfStatus &= ~EMmsConfNokFreeModeOnly; + iConfStatus &= ~EMmsConfNokScalingNeeded; } - else if (showNote && launchEditorQuery()) + else if (showNote) { - // Query accepted. - // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode - confStatus &= ~EMmsConfNokFreeModeOnly; - confStatus &= ~EMmsConfNokScalingNeeded; + HbMessageBox::question(INSERT_QUERY_CONFRM, this, SLOT(onDialogInsertMedia(HbAction*))); } else { @@ -145,10 +143,10 @@ } } } - else if (confStatus & EMmsConfNokDRM || confStatus - & EMmsConfNokNotEnoughInfo || confStatus - & EMmsConfNokNotSupported || confStatus - & EMmsConfNokFreeModeOnly || confStatus & EMmsConfNokCorrupt) + else if (iConfStatus & EMmsConfNokDRM || iConfStatus + & EMmsConfNokNotEnoughInfo || iConfStatus + & EMmsConfNokNotSupported || iConfStatus + & EMmsConfNokFreeModeOnly || iConfStatus & EMmsConfNokCorrupt) { // Sanity check // "Not conformant" assumed if check fails. @@ -237,13 +235,20 @@ return retValue; } -// --------------------------------------------------------- -// MmsConformanceCheck::launchEditorQuery -// --------------------------------------------------------- +// ----------------------------------------------------------------------------- +// MmsConformanceCheck::onDialogInsertMedia +// ----------------------------------------------------------------------------- // -bool MmsConformanceCheck::launchEditorQuery() +void MmsConformanceCheck::onDialogInsertMedia(HbAction* action) { - return HbMessageBox::question(INSERT_QUERY_CONFRM); + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + // Query accepted. + // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode + iConfStatus &= ~EMmsConfNokFreeModeOnly; + iConfStatus &= ~EMmsConfNokScalingNeeded; + } + } // ----------------------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h --- a/messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h Fri May 14 15:49:35 2010 +0300 @@ -39,7 +39,7 @@ /** * Constructor */ - MsgAttachmentContainer(const QString& pluginPath, QGraphicsItem *parent = 0); + MsgAttachmentContainer( QGraphicsItem *parent = 0); /** * Destructor @@ -104,11 +104,7 @@ int messageSize(); private: - /** - * style plugin's path - */ - QString mPluginPath; - + /** * container's layout */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgmonitor.h --- a/messagingapp/msgui/unifiededitor/inc/msgmonitor.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgmonitor.h Fri May 14 15:49:35 2010 +0300 @@ -93,12 +93,17 @@ * seeker funtion to get max recipient count for mms */ static inline int maxMmsRecipients(); + + /** + * get total address count in To, Cc & Bcc fields + */ + static inline int msgAddressCount(); public slots: /** - * slot to find any msg type change during editor operations + * slot to handle content change in any editor component */ - void checkMsgTypeChange(); + void handleContentChange(); private: /** @@ -107,9 +112,16 @@ void init(); /** - * handle size change of editor components + * Determine the projected msg type due to change in editor content */ - void updateSizeInfo(HbWidget* aWidget); + ConvergedMessage::MessageType projectedMsgType(); + + /** + * update various msg info changes during editing + * @param senderWidget, Editor widget which triggered + * content change slot + */ + void updateMsgInfo(HbWidget* senderWidget); /** * show type change discreet note @@ -120,8 +132,33 @@ * accessor for view */ MsgUnifiedEditorView* view(); - + + /** + * check editor body for MMS content + * @return true if MMS content is present + */ + bool bodyHasMMSContent(); + + /** + * check editor subject for MMS content + * @return true if MMS content is present + */ + bool subjectHasMMSContent(); + + /** + * check editor attachment container for MMS content + * @return true if MMS content is present + */ + bool containerHasMMSContent(); + + /** + * check for other MMS content criteria + * @return true if MMS criteria is met + */ + bool otherMMSCriteriaMet(); + private: + /** * Flag to skip showing the type change popup. * Note need to be skipped when an mms is opened from draft. @@ -162,6 +199,11 @@ * max recipient count in an sms */ static int mMaxMmsRecipients; + + /** + * current msg address count (to + cc + bcc) + */ + static int mMsgCurrAddressCount; /** * UniEditorGenUtils object diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgmonitor.inl --- a/messagingapp/msgui/unifiededitor/inc/msgmonitor.inl Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgmonitor.inl Fri May 14 15:49:35 2010 +0300 @@ -99,4 +99,13 @@ return mMaxMmsRecipients; } +//--------------------------------------------------------------- +// MsgMonitor::msgAddressCount +// @see header file +//--------------------------------------------------------------- +inline int MsgMonitor::msgAddressCount() +{ + return mMsgCurrAddressCount; +} + // End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h Fri May 14 15:49:35 2010 +0300 @@ -18,7 +18,7 @@ #ifndef UNIFIED_EDITOR_ADDRESS_H #define UNIFIED_EDITOR_ADDRESS_H -#include +#include #include #include @@ -26,9 +26,10 @@ class HbTextItem; class HbPushButton; class HbLineEdit; +class HbAction; class MsgUnifiedEditorLineEdit; -class MsgUnifiedEditorAddress : public HbWidget +class MsgUnifiedEditorAddress : public MsgUnifiedEditorBaseWidget { Q_OBJECT @@ -38,7 +39,6 @@ * Constructor */ MsgUnifiedEditorAddress(const QString& label, - const QString& pluginPath, QGraphicsItem *parent = 0); /** @@ -48,9 +48,10 @@ /** * Seeker method to return back data to editor's view - * Removes duplicates. + * By default, does not remove duplicates. + * @param removeDuplicates, True if duplicate removal is needed */ - ConvergedMessageAddressList addresses(); + ConvergedMessageAddressList addresses(bool removeDuplicates=false); /** * Get total number of recipient's (including duplicates) @@ -59,14 +60,31 @@ /** * setter method to set address + * @param addrlist, list of addresses to be set in address editor */ void setAddresses(ConvergedMessageAddressList addrlist); - + /** * Get amount of digits to be used in contact matching */ static int contactMatchDigits(); - + + /** + * setter method to enable flag to skip max recipient limit query + */ + void skipMaxRecipientQuery(bool skip); + + /** + * validate contacts + */ + bool validateContacts(); + +public slots: + /** + * To set focus on editable field. + */ + void setFocus(); + signals: /** * Emitted when send button from virtual ITUT is pressed. @@ -79,7 +97,7 @@ void contentChanged(); private slots: - + /** * called after selection from pbk. */ @@ -88,22 +106,32 @@ * Slot for handling valid returns from the phonebook contacts fetched. */ void handleOk(const QVariant& result); - + /** - * Slot for handling errors. Error ids are provided as + * Slot for handling errors. Error ids are provided as */ void handleError(int errorCode, const QString& errorMessage); /** * Called when contentsChanged signal is emitted by the line edit */ - void onContentsAdded(const QString&); + void onContentsChanged(const QString&); /** - * Called when contentsChanged signal is emitted by the line edit - * Checks for empty text content + * launch query for recipient limit usecase */ - void onContentsRemoved(const QString& text); + void handleRecipientLimitReached(); + + /** + * This slot is called when max recipients reached dialog is launched. + * @param action selected action (yes or no). + */ + void onMaxRecipientsReached(HbAction*); + + /** + * Handle invalid contact dialog useraction + */ + void handleInvalidContactDialog(HbAction* act); private: /** @@ -115,13 +143,19 @@ * Add edit-field's user-added addresses to Map */ void syncAdditionsToMap(); - + /** * Removes duplicate addresses and gives unique address list */ QStringList uniqueAddressList(); + + /** + * Reset the addresslist to previous list + */ + void resetToPrevious(); + private: - + /** * Push button to launch phone book. */ @@ -133,15 +167,39 @@ MsgUnifiedEditorLineEdit* mAddressEdit; /** - * string to hold plugin path. - */ - QString mPluginPath; - - /** * address map. */ QMap mAddressMap; - + + /** + * holds the previous buffer inside address field + */ + QString mPrevBuffer; + + /** + * flag to skip max recipient limit query + */ + bool mSkipMaxRecipientQuery; + + /** + * flag to indicate that the SMS recipient limit is about + * to be exceeded by a bulk insertion of addresses e.g. multiple + * selection from contact selection dialog + */ + bool mAboutToExceedMaxSmsRecipients; + + /** + * flag to indicate that the MMS recipient limit is about + * to be exceeded by a bulk insertion of addresses e.g. multiple + * selection from contact selection dialog + */ + bool mAboutToExceedMaxMmsRecipients; + + /** + * count by which a bulk-insertion will exceed max MMS recipient + * limit e.g. multiple selection from contact selection dialog + */ + int mExceedsMaxMmsRecipientsBy; }; #endif //UNIFIED_EDITOR_ADDRESS_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h Fri May 14 15:49:35 2010 +0300 @@ -34,8 +34,7 @@ /** * Constructor */ - MsgUnifiedEditorAttachment( const QString& pluginPath, - const QString& attachmentpath, + MsgUnifiedEditorAttachment( const QString& attachmentpath, const int filesize, QGraphicsItem *parent = 0 ); @@ -68,7 +67,10 @@ */ bool isMultimediaContent(); - HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; + /* + * Depricated + */ + // HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; protected: /** @@ -119,11 +121,6 @@ private: /** - * style plugin path - */ - QString mPluginPath; - - /** * attachment file's path */ QString mPath; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Fri May 14 15:49:35 2010 +0300 @@ -18,7 +18,7 @@ #ifndef UNIFIED_EDITOR_BODY_H #define UNIFIED_EDITOR_BODY_H -#include +#include #include #include "msgunieditorprocessimageoperation.h" @@ -27,7 +27,7 @@ class HbFrameItem; class HbIconItem; class HbPushButton; -class HbGestureSceneFilter; +//class HbGestureSceneFilter; class CMsgMediaResolver; class CMsgImageInfo; class MmsConformanceCheck; @@ -35,7 +35,8 @@ class UniEditorPluginLoader; -class MsgUnifiedEditorBody : public HbWidget,public MUniEditorProcessImageOperationObserver +class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget, + public MUniEditorProcessImageOperationObserver { Q_OBJECT @@ -46,7 +47,7 @@ /** * Constructor */ - MsgUnifiedEditorBody(const QString& pluginPath, QGraphicsItem *parent = 0); + MsgUnifiedEditorBody(QGraphicsItem *parent = 0); /** * Destructor @@ -80,6 +81,23 @@ */ void disableCharCounter(); + /** + * To set focus on editable field. + */ + void setFocus(); + + /** + * Get to find body already contains an image + * @return bool + */ + bool hasImage(); + + /** + * Get to find body already contains an audio + * @return bool + */ + bool hasAudio(); + public slots: /** * Called to insert image content in editor. @@ -94,12 +112,6 @@ void setAudio(QString& audiofile); /** - * Called to insert video content in editor. - * @param medialist list of absolute paths of media. - */ - void setVideo(QString& videofile); - - /** * Called to insert body text in editor. * @param text body text. */ @@ -169,11 +181,6 @@ void handleError(int errorCode, const QString& errorMessage); private: - /** - * Get to find body already contains an image - * @return bool - */ - bool hasImage(); /** * Get to find body already contains an image @@ -182,12 +189,6 @@ void setImage(bool image = false); /** - * Get to find body already contains an audio - * @return bool - */ - bool hasAudio(); - - /** * Set that body now contains an audio */ void setAudio(bool audio = false); @@ -251,11 +252,6 @@ */ HbPushButton* mAudioItem; - /** - * string to hold plug in path. - */ - QString mPluginPath; - /** * Image file contained inside body */ @@ -279,7 +275,7 @@ /** * To setup longpress gesture on media objects */ - HbGestureSceneFilter* mGestureFilter; + //HbGestureSceneFilter* mGestureFilter; /** * MMs conformance check utility class @@ -302,11 +298,6 @@ int mVideoSize; /** - * Rfs object - */ - RFs mfs; - - /** * CUniEditorProcessImageOperation object */ CUniEditorProcessImageOperation *mProcessImageOperation; @@ -363,6 +354,11 @@ * Maintains information if any unicode character has been entered or not */ bool mUnicode; + + /** + * Content widget for processing animation. + */ + HbWidget* mProcessingWidget; }; #endif //UNIFIED_EDITOR_BODY_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h Fri May 14 15:49:35 2010 +0300 @@ -23,12 +23,13 @@ // INCLUDES #include +#include #include #include #include #include - +#include // FORWARD DECLARATIONS @@ -37,7 +38,7 @@ class CUniEditorDocument; class MMsvAttachmentManager; class CMsvStore; - +class HbAction; // DATA TYPES // CLASS DECLARATION @@ -68,17 +69,18 @@ * * @since 3.2 */ -class CUniEditorProcessImageOperation : public CActive, +class CUniEditorProcessImageOperation : public QObject,public CActive, public MUniImageProcessorCallback { + Q_OBJECT + public: // new operations /** * Factory method */ static CUniEditorProcessImageOperation* NewL( - MUniEditorProcessImageOperationObserver &aObserver, - RFs& aFs ); + MUniEditorProcessImageOperationObserver &aObserver); /** * Start image process operation @@ -133,8 +135,7 @@ * C++ constructor */ CUniEditorProcessImageOperation( - MUniEditorProcessImageOperationObserver &aObserver, - RFs& aFs ); + MUniEditorProcessImageOperationObserver &aObserver); /** * 2nd phase constructor. @@ -206,6 +207,19 @@ */ void CompleteOperation( TInt aError ); + /** + * Check image size + */ + void checkLargeImage(); + + private slots: + + /** + * This slot is called when large image insertion query dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogLargeImage(HbAction* action); + private: // data enum TUniProcessStates @@ -244,7 +258,8 @@ TInt iMaxImageWidth; TInt iMaxImageHeight; TInt iMmsCreationMode; - RFs& iFs; + RFs iFs; + TBool largeImageQuery; }; #endif //__UNIEDITORPROCESSIMAGEOPERATION_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h Fri May 14 15:49:35 2010 +0300 @@ -17,7 +17,7 @@ #ifndef UNIFIED_EDITOR_SUBJECT_H #define UNIFIED_EDITOR_SUBJECT_H -#include +#include #include "convergedmessage.h" @@ -25,7 +25,7 @@ class UniEditorGenUtils; class MsgUnifiedEditorLineEdit; -class MsgUnifiedEditorSubject : public HbWidget +class MsgUnifiedEditorSubject : public MsgUnifiedEditorBaseWidget { Q_OBJECT @@ -34,7 +34,7 @@ /** * Constructor */ - MsgUnifiedEditorSubject(const QString& pluginPath, QGraphicsItem *parent = 0); + MsgUnifiedEditorSubject(QGraphicsItem *parent = 0); /** * Destructor @@ -67,6 +67,11 @@ * @param text */ void setText(const QString& text); + + /** + * To set focus on editable field. + */ + void setFocus(); signals: /** @@ -78,13 +83,7 @@ /** * called when contentsChanged signal is emitted by the line edit */ - void onContentsAdded(const QString&); - - /** - * Called when contentsChanged signal is emitted by the line edit - * Checks for empty text content - */ - void onContentsRemoved(const QString& text); + void onContentsChanged(const QString&); private: /** @@ -96,11 +95,6 @@ private: /** - * plug in path. - */ - QString mPluginPath; - - /** * line edit to input subject. */ MsgUnifiedEditorLineEdit* mSubjectEdit; @@ -119,6 +113,11 @@ * general utilities */ UniEditorGenUtils* mGenUtils; + + /** + * Holds the previous buffer inside subject field + */ + QString mPrevBuffer; }; #endif //UNIFIED_EDITOR_SUBJECT_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunieditorview.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Fri May 14 15:49:35 2010 +0300 @@ -24,15 +24,10 @@ #define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT #endif -#include #include "msgbaseview.h" #include "convergedmessage.h" #include "convergedmessageid.h" -QTM_BEGIN_NAMESPACE -QTM_END_NAMESPACE -QTM_USE_NAMESPACE - class HbWidget; class HbAction; class HbGroupBox; @@ -44,6 +39,9 @@ class MsgAttachmentContainer; class UniEditorPluginLoader; class HbListWidgetItem; +class HbAbstractVkbHost; +class MsgUnifiedEditorBaseWidget; +class HbListWidget; class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView { @@ -98,14 +96,12 @@ void addToolBar(); /** - * helper method to get style plugin path. + * Packs the content inside editor into converged message + * @param [OUT]msg, converged message to hold editor data + * @param isSave, flag to indicate that msg needs to be packed + * for saving to draft or not */ - QString pluginPath(); - - /** - * Packs the content inside editor into converged message - */ - void packMessage(ConvergedMessage &msg); + void packMessage(ConvergedMessage &msg, bool isSave=false); /** * Populate editor with prepopulated msg content @@ -140,15 +136,52 @@ void fetchImages(); /** - * Fectch conatcts + * Fetch contacts */ void fetchContacts(); /** - * Fectch audio + * Fetch audio */ void fetchAudio(); + /** + * To hide/show chrome. + */ + void hideChrome(bool hide); + + /** + * To initialize view. + */ + void initView(); + + /** + * Creates temp folder for editor. + */ + bool createTempFolder(); + + /** + * Removes editors temp folder. + */ + void removeTempFolder(); + + /** + * Attachment options in TBE + * Row number of the TBE actions + */ + enum TBE_AttachOption + { + TBE_PHOTO = 0x00, TBE_SOUND = 0x01, TBE_VCARD = 0x02 + }; + + /** + * Enable/Disable attachment options for slide-conformance + * @param opt, row number of action in TBE + * @param isEnabled, true/false + */ + void setAttachOptionEnabled(MsgUnifiedEditorView::TBE_AttachOption opt, + bool enable); + private slots: /** @@ -239,7 +272,52 @@ * Deactivate Input Blocker */ void deactivateInputBlocker(); + + /** + * Resizes the view when VKB is opened. + * This slot is triggered when vkb is opened. + */ + void vkbOpened(); + /** + * Resizes the view when VKB is closed. + * This slot is triggered when VKB focus is lost. + */ + void vkbClosed(); + + /** + * Slot to do delayed construction. + */ + void doDelayedConstruction(); + + /** + * Sets focus to item. + */ + void setFocus(MsgUnifiedEditorBaseWidget* item); + + /** + * Listens to contentChanged signal of various fields. + */ + void onContentChanged(); + + /** + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogDeleteMsg(HbAction* action); + + /** + * This slot is called when define sms settings dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogSmsSettings(HbAction* action); + + /** + * This slot is called when define mms settings dialog is launched. + * @param action selected action (yes or no). + */ + void onDialogMmsSettings(HbAction* action); + private: HbAction* mSubjectAction; HbAction* mCcBccAction; @@ -251,7 +329,6 @@ MsgUnifiedEditorBody* mBody; HbWidget* mContentWidget; - QString mPluginPath; MsgMonitor* mMsgMonitor; MsgAttachmentContainer* mAttachmentContainer; @@ -259,6 +336,17 @@ ConvergedMessageId mOpenedMessageId; ConvergedMessage::MessageType mmOpenedMessageType; bool mCanSaveToDrafts; + + /** + * TBE's content widget + */ + HbListWidget* mTBExtnContentWidget; + + /** + * Instance of VKB host + */ + HbAbstractVkbHost* mVkbHost; + friend class MsgMonitor; }; diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunifiededitorbasewidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunifiededitorbasewidget.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,35 @@ +/* + * 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:common base class for editor fields(address field,subject field, + * and body field. + * + */ + +#include + +#ifndef MSGUNIFIEDEDITORBASEWIDGET_H_ +#define MSGUNIFIEDEDITORBASEWIDGET_H_ + +class MsgUnifiedEditorBaseWidget: public HbWidget +{ + Q_OBJECT + +public: + MsgUnifiedEditorBaseWidget(QGraphicsItem *parent = 0):HbWidget(parent){} + virtual void setFocus(){} + +}; + + +#endif /* MSGUNIFIEDEDITORBASEWIDGET_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h --- a/messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h Fri May 14 15:49:35 2010 +0300 @@ -42,14 +42,34 @@ */ QStringList addresses(); + /** + * Flag to retain or override base-class behaviour + * Needed because address & subject field classes derieve + * from this class, but have different behaviour + */ void setDefaultBehaviour(bool defaultBehaviour = false); + + /** + * seeker method for getting the text content held by editing field + */ QString content() const; - + + /** + * setter method to clear text content of the editing field + */ + void clearContent(); + + /** + * set highlight on invalid contact + * @param invalidStr, String to be highlighted + */ + void highlightInvalidString(QString invalidStr); + signals: void contentsChanged(const QString& text); public slots: - void setText(const QString &text); + void setText(const QString &text, bool underlined = true); void cut(); void selectAll(); @@ -62,6 +82,7 @@ void keyPressEvent(QKeyEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); void focusInEvent(QFocusEvent* event); + void focusOutEvent(QFocusEvent *event); void timerEvent (QTimerEvent *event); diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/animation.axml --- a/messagingapp/msgui/unifiededitor/resources/animation.axml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - -:/qtg_anim_longtap_1.svg -:/qtg_anim_longtap_2.svg -:/qtg_anim_longtap_3.svg -:/qtg_anim_longtap_4.svg -:/qtg_anim_longtap_5.svg -:/qtg_anim_longtap_6.svg -:/qtg_anim_longtap_7.svg -:/qtg_anim_longtap_8.svg -:/qtg_anim_longtap_9.svg - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitoraddress.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitoraddress.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,21 @@ +HbWidget { + margin-left: 0un; + margin-top: 0un; +} +MsgUnifiedEditorAddress { + layout:layout-default; +} + +MsgUnifiedEditorAddress::launchBtn { + right: var(hb-param-margin-gene-right); + fixed-width: 9.5un; + fixed-height: 7.46un; +} + +MsgUnifiedEditorAddress::addressField { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-middle-horizontal); + min-height: 7.46un; + } + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitoraddress.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitoraddress.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,44 @@ +HbWidget { + margin-left: 0un; + margin-top: 0un; +} + +MsgUnifiedEditorAttachment { + layout:layout-default; +} + +MsgUnifiedEditorAttachment::attachmentIcon +{ + top:-var(hb-param-margin-gene-top); + left:-var(hb-param-margin-gene-left); + bottom:var(hb-param-margin-gene-bottom); + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-primary-small); + pref-height:var(hb-param-graphic-size-primary-small); +} + +MsgUnifiedEditorAttachment::attachmentName +{ + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); + text-height:var(hb-param-text-height-secondary); + text-line-count-min:1; + text-line-count-max:1; +} + +MsgUnifiedEditorAttachment::attachmentDetails +{ + right:var(hb-param-margin-gene-right); + text-height:var(hb-param-text-height-tiny); + text-line-count-min:1; + text-line-count-max:1; + fixed-width: 13.0un; + text-align:right; +} + +MsgUnifiedEditorAttachment::bgFrame +{ + zvalue:-1; +} + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,96 @@ +HbWidget { + margin-left: 0un; + margin-top: 0un; +} + +/********************************* LAYOUTS ***********************************/ +MsgUnifiedEditorBody:portrait { + layout: layout-portrait; +} + +MsgUnifiedEditorBody[hasImage="false"]:landscape { + layout: layout-landscape-no-image; +} + +MsgUnifiedEditorBody[hasImage="true"]:landscape { + layout: layout-landscape-image; +} + +/**************************** Text field margin ******************************/ +MsgUnifiedEditorBody::textEdit:portrait { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); +} + +MsgUnifiedEditorBody[hasImage="true"][hasAudio="true"]::textEdit:portrait { + top: -var(hb-param-margin-gene-middle-vertical); +} + +MsgUnifiedEditorBody[hasImage="true"][hasAudio="false"]::textEdit:portrait { + top: -var(hb-param-margin-gene-middle-vertical); +} + +MsgUnifiedEditorBody[hasImage="false"][hasAudio="true"]::textEdit:portrait { + top: -var(hb-param-margin-gene-middle-vertical); +} + +MsgUnifiedEditorBody[hasImage="false"][hasAudio="false"]::textEdit:portrait { + top: 0.0un; +} + +MsgUnifiedEditorBody::textEdit:landscape { + right: var(hb-param-margin-gene-right); +} + +MsgUnifiedEditorBody[hasImage="true"]::textEdit:landscape { + left: -1.0un; +} + +MsgUnifiedEditorBody[hasImage="false"]::textEdit:landscape { + left: -var(hb-param-margin-gene-left); +} + +MsgUnifiedEditorBody[hasAudio="true"]::textEdit:landscape { + top: -var(hb-param-margin-gene-middle-vertical); +} + +MsgUnifiedEditorBody[hasAudio="false"]::textEdit:landscape { + top: 0.0un; +} + +/*************************** Image field margin ******************************/ +MsgUnifiedEditorBody::pixmap { + left: -var(hb-param-margin-gene-left); +} + +MsgUnifiedEditorBody::pixmap:portrait { + right: var(hb-param-margin-gene-right); +} + +MsgUnifiedEditorBody::pixmap:landscape { + right: 1.0un; +} + +MsgUnifiedEditorBody[hasAudio="true"]::pixmap { + top: -var(hb-param-margin-gene-middle-vertical); +} + +MsgUnifiedEditorBody[hasAudio="false"]::pixmap { + top: 0.0un; +} + +/*************************** Audio field margin ******************************/ + +MsgUnifiedEditorBody::audioItem { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); +} + +/*************************** Character Counter ******************************/ +MsgUnifiedEditorBody::charCounter +{ + size-policy:fixed fixed; + pref-height:-1; + pref-width:-1; + text-height:var(hb-param-text-height-tiny); +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorsubject.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorsubject.css Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,21 @@ +HbWidget { + margin-left: 0un; + margin-top: 0un; +} + +MsgUnifiedEditorSubject { + layout:layout-default; +} + +MsgUnifiedEditorSubject::priorityIcon { + fixed-height: var(hb-param-graphic-size-secondary); + fixed-width: var(hb-param-graphic-size-secondary); + right: var(hb-param-margin-gene-right); + left: -0.5un; +} + +MsgUnifiedEditorSubject::subjectEdit { + left: -var(hb-param-margin-gene-left); + min-height:7.46un; + } + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorsubject.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorsubject.widgetml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_loading.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/qtg_anim_loading.axml Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,14 @@ + + +qtg_anim_loading_1 +qtg_anim_loading_2 +qtg_anim_loading_3 +qtg_anim_loading_4 +qtg_anim_loading_5 +qtg_anim_loading_6 +qtg_anim_loading_7 +qtg_anim_loading_8 +qtg_anim_loading_9 +qtg_anim_loading_10 + + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_1.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_1.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_2.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_2.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_3.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_3.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_4.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_4.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_5.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_5.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_6.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_6.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_7.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_7.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_8.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_8.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_9.svg --- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_longtap_9.svg Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp --- a/messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp Fri May 14 15:49:35 2010 +0300 @@ -34,9 +34,8 @@ // MsgAttachmentContainer::MsgAttachmentContainer // @see header file //--------------------------------------------------------------- -MsgAttachmentContainer::MsgAttachmentContainer( const QString& pluginPath, QGraphicsItem *parent ) : +MsgAttachmentContainer::MsgAttachmentContainer( QGraphicsItem *parent ) : HbWidget(parent), -mPluginPath(pluginPath), mIsMMContent(false) { mLayout = new QGraphicsLinearLayout(Qt::Vertical, this); @@ -72,7 +71,7 @@ if( (fileSize + msgSize) <= MsgMonitor::maxMmsSize()) { MsgUnifiedEditorAttachment* att = new MsgUnifiedEditorAttachment( - mPluginPath, filepath, fileSize, this); + filepath, fileSize, this); if( ((mAttachmentList.count() == 0) && att->isMultimediaContent()) || ((mAttachmentList.count() == 1) && !mIsMMContent) ) { diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgmonitor.cpp --- a/messagingapp/msgui/unifiededitor/src/msgmonitor.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgmonitor.cpp Fri May 14 15:49:35 2010 +0300 @@ -39,6 +39,7 @@ int MsgMonitor::mMaxMmsSize; int MsgMonitor::mMaxSmsRecipients; int MsgMonitor::mMaxMmsRecipients; +int MsgMonitor::mMsgCurrAddressCount; //Localized strings #define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul") @@ -75,6 +76,7 @@ mBodySize = 0; mContainerSize = 0; mSubjectSize = 0; + mMsgCurrAddressCount = 0; UniEditorGenUtils* uniEditorGenUtils = new UniEditorGenUtils; @@ -91,139 +93,104 @@ } //--------------------------------------------------------------- -// MsgMonitor::checkMsgTypeChange +// MsgMonitor::handleContentChange // @see header file //--------------------------------------------------------------- -void MsgMonitor::checkMsgTypeChange() +void MsgMonitor::handleContentChange() { - // fetch editor's content - MsgUnifiedEditorBody* edBody = view()->mBody; - QStringList objList = edBody->mediaContent(); - QString bodyText = edBody->text(); - - MsgUnifiedEditorSubject* edSubject = view()->mSubjectField; - ConvergedMessage::Priority priority = ConvergedMessage::Normal; - QString subjectText; - if(edSubject) - { - priority = edSubject->priority(); - subjectText = edSubject->text(); - } - - MsgUnifiedEditorAddress* edCc = view()->mCcField; - MsgUnifiedEditorAddress* edBcc = view()->mBccField; - int ccCount = 0; - int bccCount = 0; - if(edCc && edBcc) - { - ccCount = edCc->addressCount(); - bccCount = edBcc->addressCount(); - } - - MsgAttachmentContainer* edContainer = view()->mAttachmentContainer; - bool hasMMAttachmentContent = false; - int attachmentCount = 0; - if(edContainer) + // get the projected message type & show the type change note + ConvergedMessage::MessageType newMsgType = projectedMsgType(); + if(mMessageType != newMsgType) { - hasMMAttachmentContent = edContainer->hasMMContent(); - attachmentCount = edContainer->count(); - } - - // find out the msgtype based on content - ConvergedMessage::MessageType projectedMsgType = ConvergedMessage::Sms; - - // check for presence of MMS content - // 1. If any media-object is present inside body - // 2. If priority is set to other than Normal - // 3. If subject has some content - // 4. If CC/BCC has some content - // 5. If MM attachments are present - // 6. If only one non-MM attachment is present e.g. vcf - // and body text is also present - // 7. If body text size exceeds sms text-size limit - if( !objList.isEmpty() || - (priority != ConvergedMessage::Normal) || - !subjectText.isEmpty() || - (ccCount || bccCount) || - hasMMAttachmentContent || - ((attachmentCount == 1) && !bodyText.isEmpty()) - ) - { - projectedMsgType = ConvergedMessage::Mms; - } - else - { - projectedMsgType = ConvergedMessage::Sms; - } - - // optimization 1: if projected type is still sms means - // the message under composition has only plain text - if(projectedMsgType == ConvergedMessage::Sms) - { - bool hasUnicodeText = edBody->isUnicode(); - int bodyTextSize = mUniEditorGenUtils->UTF8Size(bodyText); - int maxSmsSize = mUniEditorGenUtils->MaxSmsMsgSizeL(hasUnicodeText); - if(bodyTextSize > maxSmsSize) - { - projectedMsgType = ConvergedMessage::Mms; - } - } - - // show type change note, if needed - if(mMessageType != projectedMsgType) - { - mMessageType = projectedMsgType; + mMessageType = newMsgType; QString noteStr; - if(projectedMsgType == ConvergedMessage::Sms) + if(newMsgType == ConvergedMessage::Sms) { noteStr = LOC_POP_MESSAGE_CHANGE_TEXT; } else { noteStr = LOC_POP_MESSAGE_CHANGE_MUL; - - //Disable char counter - edBody->disableCharCounter(); } showPopup(noteStr); } - - // update size of editor component + HbWidget* senderWidget = qobject_cast(sender()); - updateSizeInfo(senderWidget); + updateMsgInfo(senderWidget); +} + +//--------------------------------------------------------------- +// MsgMonitor::projectedMsgType +// @see header file +//--------------------------------------------------------------- +ConvergedMessage::MessageType MsgMonitor::projectedMsgType() +{ + ConvergedMessage::MessageType newMsgType = ConvergedMessage::Sms; + + // check if MMS content is present in any of the editor component + if( bodyHasMMSContent() || + subjectHasMMSContent() || + containerHasMMSContent() || + otherMMSCriteriaMet() ) + { + newMsgType = ConvergedMessage::Mms; + } + return newMsgType; } //--------------------------------------------------------------- -// MsgMonitor::updateSizeInfo +// MsgMonitor::updateMsgInfo // @see header file //--------------------------------------------------------------- -void MsgMonitor::updateSizeInfo(HbWidget* aWidget) +void MsgMonitor::updateMsgInfo(HbWidget* senderWidget) { - // if sent by body widget - MsgUnifiedEditorBody* body = NULL; - body = qobject_cast(aWidget); + if(mMessageType == ConvergedMessage::Mms) + { + //Disable char counter & add subject + view()->mBody->disableCharCounter(); + view()->addSubject(); + } + + // check if sent by body widget + MsgUnifiedEditorBody* body = NULL; + body = qobject_cast(senderWidget); if(body) { mBodySize = view()->mBody->bodySize(); + view()->setAttachOptionEnabled( + MsgUnifiedEditorView::TBE_PHOTO, !view()->mBody->hasImage()); + view()->setAttachOptionEnabled( + MsgUnifiedEditorView::TBE_SOUND, !view()->mBody->hasAudio()); return; } - // if sent by attachment container widget + // check if sent by subject widget + MsgUnifiedEditorSubject* subject = NULL; + subject = qobject_cast(senderWidget); + if(subject) + { + mSubjectSize = view()->mSubjectField->subjectSize(); + return; + } + + // check if sent by attachment container widget MsgAttachmentContainer* container = NULL; - container = qobject_cast(aWidget); + container = qobject_cast(senderWidget); if(container) { mContainerSize = view()->mAttachmentContainer->containerSize(); return; } - // if sent by subject widget - MsgUnifiedEditorSubject* subject = NULL; - subject = qobject_cast(aWidget); - if(subject) + // handle content change from other widgets e.g. To, Cc, Bcc address field + int totalAddressCount = view()->mToField->addressCount(); + if(view()->mCcField && view()->mBccField) { - mSubjectSize = view()->mSubjectField->subjectSize(); + totalAddressCount += view()->mCcField->addressCount() + + view()->mBccField->addressCount(); } + mMsgCurrAddressCount = totalAddressCount; + return; } //--------------------------------------------------------------- @@ -254,4 +221,112 @@ return static_cast(this->parent()); } +//--------------------------------------------------------------- +// MsgMonitor::bodyHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgMonitor::bodyHasMMSContent() +{ + MsgUnifiedEditorBody* edBody = view()->mBody; + // If any media-object is present inside body + if(!edBody->mediaContent().isEmpty()) + { + return true; + } + + int bodyTextSize = mUniEditorGenUtils->UTF8Size(edBody->text()); + int maxSmsSize = 0; + TRAP_IGNORE(maxSmsSize = + mUniEditorGenUtils->MaxSmsMsgSizeL(edBody->isUnicode())); + // If body text size exceeds sms text-size limit + if(bodyTextSize > maxSmsSize) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgMonitor::subjectHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgMonitor::subjectHasMMSContent() +{ + MsgUnifiedEditorSubject* edSubject = view()->mSubjectField; + ConvergedMessage::Priority priority = ConvergedMessage::Normal; + QString subjectText; + if(edSubject) + { + priority = edSubject->priority(); + subjectText = edSubject->text(); + } + // If priority is set to other than Normal or + // If subject has some content + if( (priority != ConvergedMessage::Normal) || + !subjectText.isEmpty() ) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgMonitor::containerHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgMonitor::containerHasMMSContent() +{ + QString bodyText = view()->mBody->text(); + MsgAttachmentContainer* edContainer = view()->mAttachmentContainer; + bool hasMMAttachmentContent = false; + int attachmentCount = 0; + if(edContainer) + { + hasMMAttachmentContent = edContainer->hasMMContent(); + attachmentCount = edContainer->count(); + } + // If MM attachments are present or + // If only one non-MM attachment is present e.g. vcf along with body text + if( hasMMAttachmentContent || + ((attachmentCount == 1) && !bodyText.isEmpty()) ) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgMonitor::otherMMSCriteriaMet +// @see header file +//--------------------------------------------------------------- +bool MsgMonitor::otherMMSCriteriaMet() +{ + MsgUnifiedEditorAddress* edCc = view()->mCcField; + MsgUnifiedEditorAddress* edBcc = view()->mBccField; + int ccCount = 0; + int bccCount = 0; + if(edCc && edBcc) + { + ccCount = edCc->addressCount(); + bccCount = edBcc->addressCount(); + } + // If CC/BCC has some content or + // If to-recipients count exceeds max sms recipient count + if( ccCount || bccCount || + (view()->mToField->addressCount() > mMaxSmsRecipients) ) + { + return true; + } + + // If to-field contains an email address + bool isEmailPresent = false; + ConvergedMessageAddressList addrList = view()->mToField->addresses(); + TRAP_IGNORE(isEmailPresent = mUniEditorGenUtils->VerifyEmailAddressesL(addrList)); + if(isEmailPresent) + { + return true; + } + return false; +} + //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Fri May 14 15:49:35 2010 +0300 @@ -16,40 +16,50 @@ */ // INCLUDES -#include "debugtraces.h" +#include #include #include #include #include +#include #include #include #include #include // KCRUidTelephonyConfiguration #include +#include +#include // Common phone number validity checker +#include // USER INCLUDES +#include "debugtraces.h" #include "msgunieditoraddress.h" #include "msgunifiededitorlineedit.h" +#include "msgmonitor.h" +#include "unieditorgenutils.h" const QString PBK_ICON("qtg_mono_contacts"); const QString SEND_ICON("qtg_mono_send"); +const QString replacementStr("; "); // Constants const int KDefaultGsmNumberMatchLength = 7; //matching unique ph numbers +#define LOC_SMS_RECIPIENT_LIMIT_REACHED hbTrId("txt_messaging_dialog_number_of_recipients_exceeded") +#define LOC_MMS_RECIPIENT_LIMIT_REACHED hbTrId("txt_messaging_dpopinfo_unable_to_add_more_recipien") +#define LOC_DIALOG_OK hbTrId("txt_common_button_ok") +#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") +#define LOC_INVALID_RECIPIENT hbTrId("txt_messaging_dialog_invalid_recipient_found") MsgUnifiedEditorAddress::MsgUnifiedEditorAddress( const QString& label, - const QString& pluginPath, QGraphicsItem *parent ) : -HbWidget(parent), -mPluginPath(pluginPath) +MsgUnifiedEditorBaseWidget(parent), +mSkipMaxRecipientQuery(false), +mAboutToExceedMaxSmsRecipients(false), +mAboutToExceedMaxMmsRecipients(false), +mExceedsMaxMmsRecipientsBy(0) { - #ifdef _DEBUG_TRACES_ - qDebug() << "MsgUnifiedEditorAddress calling HbStyle::registerPlugin"; - #endif + this->setContentsMargins(0,0,0,0); - this->setContentsMargins(0,0,0,0); - setPluginBaseId(style()->registerPlugin(mPluginPath)); - mLaunchBtn = new HbPushButton(this); HbStyle::setItemName(mLaunchBtn,"launchBtn"); connect(mLaunchBtn,SIGNAL(clicked()),this,SLOT(fetchContacts())); @@ -61,7 +71,7 @@ mAddressEdit->setMaxRows(40); connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); + this, SLOT(onContentsChanged(const QString&))); // add "Send" action in VKB HbEditorInterface editorInterface(mAddressEdit); @@ -69,12 +79,13 @@ HbAction *sendAction = new HbAction(HbIcon(SEND_ICON), QString(),this); connect(sendAction, SIGNAL(triggered()),this, SIGNAL(sendMessage())); editorInterface.addAction(sendAction); - } MsgUnifiedEditorAddress::~MsgUnifiedEditorAddress() { - style()->unregisterPlugin(mPluginPath); + //TODO: Should remove this code depending on orbit's reply whether it is needed + //to unregister the same plugin registered on two different widgets twice. + //style()->unregisterPlugin(mPluginPath); } void MsgUnifiedEditorAddress::fetchContacts() @@ -87,17 +98,17 @@ request = appManager.create(serviceName, "Fetch", operation, true); // embedded if ( request == NULL ) { - return; + return; } // Result handlers connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); connect (request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); - - args << QString(tr("Phonebook")); + + args << QString(tr("Phonebook")); args << KCntActionAll; args << KCntFilterDisplayAll; - + request->setArguments(args); request->send(); delete request; @@ -105,21 +116,20 @@ void MsgUnifiedEditorAddress::handleOk(const QVariant& value) { - CntServicesContactList contactList; - contactList = qVariantValue(value); + CntServicesContactList contactList = + qVariantValue(value); + int count = contactList.count(); - for(int i = 0; i < contactList.count(); i++ ) + ConvergedMessageAddressList addrlist; + for(int i = 0; i < count; i++ ) { - mAddressMap.insert(contactList[i].mPhoneNumber, contactList[i].mDisplayName); - if(!contactList[i].mDisplayName.isEmpty()) - { - mAddressEdit->setText(contactList[i].mDisplayName); - } - else - { - mAddressEdit->setText(contactList[i].mPhoneNumber); - } + ConvergedMessageAddress* address = + new ConvergedMessageAddress(); + address->setAddress(contactList[i].mPhoneNumber); + address->setAlias(contactList[i].mDisplayName); + addrlist << address; } + setAddresses(addrlist); } void MsgUnifiedEditorAddress::handleError(int errorCode, const QString& errorMessage) @@ -128,31 +138,47 @@ Q_UNUSED(errorCode) } -ConvergedMessageAddressList MsgUnifiedEditorAddress::addresses() +// ---------------------------------------------------------------------------- +// MsgUnifiedEditorAddress::addresses +// @see header +// ---------------------------------------------------------------------------- +ConvergedMessageAddressList MsgUnifiedEditorAddress::addresses( + bool removeDuplicates) { - #ifdef _DEBUG_TRACES_ - qCritical() << "MsgUnifiedEditorAddress::address start"; +#ifdef _DEBUG_TRACES_ + qCritical() << "MsgUnifiedEditorAddress::addresses start"; #endif // sync-up map to account for user-actions on edit-field syncDeletionsToMap(); syncAdditionsToMap(); - QStringList uniqueAddr; - uniqueAddr = uniqueAddressList(); - ConvergedMessageAddressList addresses; - foreach(QString addr, uniqueAddr) + if(removeDuplicates) { - ConvergedMessageAddress* address = new ConvergedMessageAddress; - address->setAddress(addr); - if(!mAddressMap.value(addr).isEmpty()) + QStringList uniqueAddr; + uniqueAddr = uniqueAddressList(); + foreach(QString addr, uniqueAddr) { + ConvergedMessageAddress* address = new ConvergedMessageAddress; + address->setAddress(addr); address->setAlias(mAddressMap.value(addr)); - } - addresses.append(address); + addresses.append(address); + } } - #ifdef _DEBUG_TRACES_ - qCritical() << "MsgUnifiedEditorAddress::address end"; + else + { + QMap::iterator i = mAddressMap.begin(); + while (i != mAddressMap.end()) + { + ConvergedMessageAddress* address = new ConvergedMessageAddress; + address->setAddress(i.key()); + address->setAlias(i.value()); + addresses.append(address); + i++; + } + } +#ifdef _DEBUG_TRACES_ + qCritical() << "MsgUnifiedEditorAddress::addresses end"; #endif return addresses; } @@ -164,60 +190,145 @@ void MsgUnifiedEditorAddress::setAddresses(ConvergedMessageAddressList addrlist) { - int count = addrlist.count(); + // ensure flags are reset before starting the addr addition + mAboutToExceedMaxSmsRecipients = false; + mAboutToExceedMaxMmsRecipients = false; + mExceedsMaxMmsRecipientsBy = 0; + + // first, we check if MMS max-recipient count will exceed + int count = addrlist.count(); + int futureCount = count + MsgMonitor::msgAddressCount(); + if(futureCount > MsgMonitor::maxMmsRecipients()) + { + mAboutToExceedMaxMmsRecipients = true; + mExceedsMaxMmsRecipientsBy = + futureCount - MsgMonitor::maxMmsRecipients(); + } + // else, check if SMS max-recipient count will exceed + else if(!mSkipMaxRecipientQuery) + { + futureCount = count + addressCount(); + if( (addressCount() <= MsgMonitor::maxSmsRecipients()) && + (futureCount > MsgMonitor::maxSmsRecipients()) ) + { + mAboutToExceedMaxSmsRecipients = true; + } + } + + for(int i = 0; i < count; i++ ) { - mAddressMap.insert(addrlist[i]->address(), addrlist[i]->alias()); + mAddressMap.insertMulti(addrlist[i]->address(), addrlist[i]->alias()); if(!addrlist[i]->alias().isEmpty()) { mAddressEdit->setText(addrlist[i]->alias()); } else { - mAddressEdit->setText(addrlist[i]->address()); + mAddressEdit->setText(addrlist[i]->address(), false); } } + + // addition operation complete, reset flags + mAboutToExceedMaxSmsRecipients = false; + mAboutToExceedMaxMmsRecipients = false; + mExceedsMaxMmsRecipientsBy = 0; } int MsgUnifiedEditorAddress::contactMatchDigits() - { +{ // Read the amount of digits to be used in contact matching - // The key is owned by PhoneApp - CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration); + // The key is owned by PhoneApp int matchDigitCount = 0; - if ( repository->Get(KTelMatchDigits, matchDigitCount) == KErrNone ) + TRAP_IGNORE( + CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration); + if ( repository->Get(KTelMatchDigits, matchDigitCount) == KErrNone ) { - // Min is 7 - matchDigitCount = Max(matchDigitCount, KDefaultGsmNumberMatchLength); + // Min is 7 + matchDigitCount = Max(matchDigitCount, KDefaultGsmNumberMatchLength); } - CleanupStack::PopAndDestroy(); // repository - + CleanupStack::PopAndDestroy(); // repository + ); return matchDigitCount; +} - } - -void MsgUnifiedEditorAddress::onContentsAdded(const QString& text) +void MsgUnifiedEditorAddress::onContentsChanged(const QString& text) { - if(!text.isEmpty()) + // Max MMS recipient count check + if( mAboutToExceedMaxMmsRecipients || + (MsgMonitor::msgAddressCount() >= MsgMonitor::maxMmsRecipients()) ) { + if(mAboutToExceedMaxMmsRecipients) + {// show discreet note only once + --mExceedsMaxMmsRecipientsBy; + if(!mExceedsMaxMmsRecipientsBy) + { + HbNotificationDialog::launchDialog( + LOC_MMS_RECIPIENT_LIMIT_REACHED); + } + resetToPrevious(); + } + else + { + // update monitor data + emit contentChanged(); + if(MsgMonitor::msgAddressCount() > MsgMonitor::maxMmsRecipients()) + { + HbNotificationDialog::launchDialog( + LOC_MMS_RECIPIENT_LIMIT_REACHED); + resetToPrevious(); + // reset monitor data + emit contentChanged(); + } + else + { + mPrevBuffer = text; + } + } + return; + } + + // Max SMS recipient count check + if( !mSkipMaxRecipientQuery && + (MsgMonitor::messageType() == ConvergedMessage::Sms) && + (mAddressEdit->addresses().count() > MsgMonitor::maxSmsRecipients()) ) + { + // when we show this dialog, we don't want the intermediate states + // to be signalled to us disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); + this, SLOT(onContentsChanged(const QString&))); + QTimer::singleShot(50, this, SLOT(handleRecipientLimitReached())); + } + else + { + if(!mAboutToExceedMaxSmsRecipients) + {// remember addresses before the block insertion started + mPrevBuffer = text; + } emit contentChanged(); - connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsRemoved(const QString&))); } } -void MsgUnifiedEditorAddress::onContentsRemoved(const QString& text) +void MsgUnifiedEditorAddress::handleRecipientLimitReached() { - if(text.isEmpty()) - { - disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsRemoved(const QString&))); - emit contentChanged(); - connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); - } + HbMessageBox* dlg = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->setFocusPolicy(Qt::NoFocus); + dlg->setTimeout(HbPopup::NoTimeout); + + dlg->setText(LOC_SMS_RECIPIENT_LIMIT_REACHED); + + HbAction* okAction = new HbAction(LOC_DIALOG_OK,dlg); + dlg->addAction(okAction); + + HbAction* cancelAction = new HbAction(LOC_BUTTON_CANCEL,dlg); + dlg->addAction(cancelAction); + + dlg->open(this,SLOT(onMaxRecipientsReached(HbAction*))); + // reconnect to get back updates + connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), + this, SLOT(onContentsChanged(const QString&))); + emit contentChanged(); } void MsgUnifiedEditorAddress::syncDeletionsToMap() @@ -243,19 +354,19 @@ void MsgUnifiedEditorAddress::syncAdditionsToMap() { - QStringList mapAddrList = mAddressMap.values(); - // remove already mapped addresses from edit-field QStringList userInputAddrList(mAddressEdit->addresses()); + QStringList mapAddrList = mAddressMap.values(); + mapAddrList << mAddressMap.keys(); foreach(QString addr, mapAddrList) { - userInputAddrList.removeAll(addr); + userInputAddrList.removeOne(addr); } // add the unmapped addresses to address-map foreach(QString addr, userInputAddrList) { - mAddressMap.insertMulti(addr, addr); + mAddressMap.insertMulti(addr, QString()); } } @@ -267,7 +378,7 @@ { for(int i =j+1;isetFocus(Qt::MouseFocusReason); +} + +// ---------------------------------------------------------------------------- +// MsgUnifiedEditorAddress::resetToPrevious +// @see header +// ---------------------------------------------------------------------------- +void MsgUnifiedEditorAddress::resetToPrevious() +{ + // when we do this reset operation, we don't want the intermediate states + // to be signalled to us + disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), + this, SLOT(onContentsChanged(const QString&))); + + mAddressEdit->clearContent(); + QStringList list = mPrevBuffer.split(replacementStr, + QString::SkipEmptyParts); + int count = list.count(); + QStringList valList = mAddressMap.values(); + for(int i=0; isetText(addr); + } + else + { + mAddressEdit->setText(addr, false); + } + } + syncDeletionsToMap(); + connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), + this, SLOT(onContentsChanged(const QString&))); +} + +// ---------------------------------------------------------------------------- +// MsgUnifiedEditorAddress::onMaxRecipientsReached +// @see header +// ---------------------------------------------------------------------------- +void MsgUnifiedEditorAddress::onMaxRecipientsReached(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + // accept new content, update prev-buffer + mPrevBuffer = mAddressEdit->content(); + } + else { + // reject the new content, keep the old + resetToPrevious(); + } +} + +// ---------------------------------------------------------------------------- +// MsgUnifiedEditorAddress::validateContacts +// @see header +// ---------------------------------------------------------------------------- +bool MsgUnifiedEditorAddress::validateContacts() +{ + UniEditorGenUtils* genUtils = new UniEditorGenUtils; + + // sync-up map to account for user-actions on address-field + syncDeletionsToMap(); + syncAdditionsToMap(); + + // get the list of contacts in address-field + QStringList fieldAddresses(mAddressEdit->addresses()); + + bool allValid = true; + foreach(QString addr, fieldAddresses) + { + // run address validation only if address is unmapped + // (i.e. user-inserted) + if(mAddressMap.contains(addr)) + { + // 1. perform number validation + allValid = CommonPhoneParser::IsValidPhoneNumber( + *XQConversions::qStringToS60Desc(addr), + CommonPhoneParser::ESMSNumber ); + + // 2. if number validity fails, then perform email addr validation + if( !allValid && + (MsgMonitor::messageType() == ConvergedMessage::Mms) ) + { // additional check for MMS only + allValid = genUtils->IsValidEmailAddress( + *XQConversions::qStringToS60Desc(addr) ); + } + + if(!allValid) + { + mAddressEdit->highlightInvalidString(addr); + QString invalidAddrStr = + QString(LOC_INVALID_RECIPIENT).arg(addr); + HbMessageBox* dlg = new HbMessageBox(invalidAddrStr, + HbMessageBox::MessageTypeInformation); + dlg->setDismissPolicy(HbPopup::TapInside); + dlg->setTimeout(HbPopup::NoTimeout); + dlg->setAttribute(Qt::WA_DeleteOnClose, true); + dlg->open(this, SLOT(handleInvalidContactDialog(HbAction*))); + break; + } + } + } + delete genUtils; + return allValid; +} + +void MsgUnifiedEditorAddress::handleInvalidContactDialog( + HbAction* act) +{ + Q_UNUSED(act); + QTimer::singleShot(250, this, SLOT(setFocus())); +} + Q_IMPLEMENT_USER_METATYPE(CntServicesContact) Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp Fri May 14 15:49:35 2010 +0300 @@ -25,8 +25,8 @@ #include #include #include -#include -#include +//#include +//#include #include #include @@ -49,26 +49,17 @@ const QString ATTACHMENT_ICON("qtg_small_attachment"); -MsgUnifiedEditorAttachment::MsgUnifiedEditorAttachment( const QString& pluginPath, - const QString& attachmentpath, +MsgUnifiedEditorAttachment::MsgUnifiedEditorAttachment( const QString& attachmentpath, const int filesize, QGraphicsItem *parent ) : HbWidget(parent), -mPluginPath(pluginPath), mPath(attachmentpath), mSize(filesize), -mMimeType(QString()), mAttachmentIcon(0), mAttachmentName(0), -mGestureFilter(0), +//mGestureFilter(0), mMaxSmsSize(KFirstNormalSmsLength) { -#ifdef _DEBUG_TRACES_ - qDebug() << "MsgUnifiedEditorAttachment calling HbStyle::registerPlugin"; -#endif - - setPluginBaseId(style()->registerPlugin(mPluginPath)); - //back ground HbFrameItem* backGround = new HbFrameItem(this); backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL); @@ -119,12 +110,10 @@ MsgUnifiedEditorAttachment::~MsgUnifiedEditorAttachment() { - style()->unregisterPlugin(mPluginPath); - - if(mGestureFilter) + /* if(mGestureFilter) { removeSceneEventFilter(mGestureFilter); - } + }*/ } const QString& MsgUnifiedEditorAttachment::path() @@ -223,7 +212,7 @@ void MsgUnifiedEditorAttachment::initGesture() { // Create gesture filter - mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this ); + /* mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this ); // Add gestures for longpress HbGesture* gestureLongpressed = new HbGesture( HbGesture::longpress,5 ); @@ -234,10 +223,10 @@ this, SLOT(longPressed(QPointF)) ); //install gesture filter. - this->installSceneEventFilter(mGestureFilter); + this->installSceneEventFilter(mGestureFilter);*/ } -HbFeedback::InstantEffect MsgUnifiedEditorAttachment::overrideFeedback(Hb::InstantInteraction interaction) const +/*HbFeedback::InstantEffect MsgUnifiedEditorAttachment::overrideFeedback(Hb::InstantInteraction interaction) const { switch(interaction) { @@ -245,8 +234,8 @@ case Hb::InstantClicked: return HbFeedback::Basic; default: - return HbFeedback::NoOverride; + return HbFeedback::None; } - } + }*/ // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Fri May 14 15:49:35 2010 +0300 @@ -22,24 +22,22 @@ #include #include #include -#include #include #include -#include -#include -#include +//#include +//#include #include #include -#include #include #include #include -#include #include #include #include #include #include +#include +#include #include #include @@ -68,37 +66,59 @@ const QString IMAGE_REGION("ImageRegion"); const QString INVALID_REGION("InvalidRegion"); const QString SEND_ICON("qtg_mono_send"); +const int KShowCounterLimit = 10; +const int BYTES_TO_KBYTES_FACTOR = 1024; //Localized Constants for item specific menu #define LOC_OPEN hbTrId("txt_common_menu_open") #define LOC_REMOVE hbTrId("txt_common_menu_remove") #define LOC_DETAILS hbTrId("txt_common_menu_details") #define LOC_TITLE hbTrId("txt_messaging_title_messaging") +#define LOC_UNABLE_TO_ADD_CONTENT hbTrId("txt_messaging_dpopinfo_unable_to_add_more_content") +#define LOC_UNABLE_TO_ATTACH_ITEM hbTrId("txt_messaging_dpopinfo_unable_to_attach_item_avai") +#define LOC_PROCESSING hbTrId("txt_messaging_formlabel_loading") const QString AUDIO_ICON("qtg_mono_audio"); -const QString ANIMATION_ICON(":/qtg_anim_longtap_2"); - -const TInt KShowCounterLimit = 10; +const QString ANIMATION_ICON("qtg_anim_loading"); +const QString ANIMATION_FILE(":/qtg_anim_loading.axml"); +// LOCAL FUNCTIONS -MsgUnifiedEditorBody::MsgUnifiedEditorBody( const QString& pluginPath, - QGraphicsItem *parent ) : -HbWidget(parent), +//--------------------------------------------------------------- +// showInsertFailureNote +// @return fullPath of unified editor's temporary dir +//--------------------------------------------------------------- +void showInsertFailureNote() +{ + int availableSize = + (MsgMonitor::maxMmsSize() - MsgMonitor::messageSize()) + /BYTES_TO_KBYTES_FACTOR; + QString displayStr = QString(LOC_UNABLE_TO_ATTACH_ITEM) + .arg(availableSize); + HbNotificationDialog* dlg = new HbNotificationDialog(); + dlg->setFocusPolicy(Qt::NoFocus); + dlg->setDismissPolicy(HbPopup::TapAnywhere); + dlg->setAttribute(Qt::WA_DeleteOnClose, true); + dlg->setText(displayStr); + dlg->show(); +} + + +MsgUnifiedEditorBody::MsgUnifiedEditorBody( QGraphicsItem *parent ) : +MsgUnifiedEditorBaseWidget(parent), mHasImage(false), mHasAudio(false), mTextEdit(0), mEditorFrame(0), mIconItem(0), mAudioItem(0), -mPluginPath(pluginPath), mImageSize(0), mAudioSize(0), mVideoSize(0), mProcessImageOperation(0), mMediaResolver(0), -mImageInfo(0) +mImageInfo(0), +mProcessingWidget(0) { - setPluginBaseId(style()->registerPlugin(mPluginPath)); - mTextEdit = new HbTextEdit(this); HbStyle::setItemName(mTextEdit,"textEdit"); @@ -115,16 +135,13 @@ connect(sendAction, SIGNAL(triggered()),this, SIGNAL(sendMessage())); editorInterface.addAction(sendAction); - mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); + /* mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); mGestureFilter->setLongpressAnimation(true); HbGesture *gesture = new HbGesture(HbGesture::longpress, 5); mGestureFilter->addGesture(gesture); - connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF))); + connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));*/ connect(mTextEdit, SIGNAL(contentsChanged()), this, SLOT(onTextChanged())); - mfs.Connect(); - mfs.ShareProtected(); - mMmsConformanceCheck = new MmsConformanceCheck; mCharCounter = new HbTextItem(this); @@ -146,6 +163,7 @@ mPluginInterface = mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms); + TRAP_IGNORE( CSmsSettings* settings = CSmsSettings::NewLC(); CSmsAccount* account = CSmsAccount::NewLC(); account->LoadSettingsL( *settings ); @@ -161,23 +179,18 @@ CleanupStack::PopAndDestroy( account ); CleanupStack::PopAndDestroy( settings ); + ); - //Set the mPrevBuffer to NULL initially - mPrevBuffer = QString(); - mCharCounter->setVisible(false); mBackgroundItem->setVisible(false); } MsgUnifiedEditorBody::~MsgUnifiedEditorBody() { - style()->unregisterPlugin(mPluginPath); delete mMmsConformanceCheck; delete mProcessImageOperation; delete mMediaResolver; delete mImageInfo; - //Close has to be called after ProcessImageOperation object is deleted - mfs.Close(); } QString MsgUnifiedEditorBody::text() @@ -204,7 +217,7 @@ if( !mProcessImageOperation ) { TRAP(error,mProcessImageOperation = - CUniEditorProcessImageOperation::NewL(*this, mfs)); + CUniEditorProcessImageOperation::NewL(*this)); } if( !mMediaResolver && error == KErrNone ) { @@ -214,21 +227,23 @@ if( error == KErrNone) { mMediaResolver->SetCharacterSetRecognition(EFalse); - HBufC *name = S60QConversions::qStringToS60Desc(imagefile); - RFile file = mMediaResolver->FileHandleL(*name); - - TRAP(error,mImageInfo = static_cast - (mMediaResolver->CreateMediaInfoL(file))); - if (error == KErrNone) + RFile file; + TRAP(error, file = mMediaResolver->FileHandleL(*name)); + if(error == KErrNone) { - TRAP(error, mMediaResolver->ParseInfoDetailsL(mImageInfo, file)); + TRAP(error,mImageInfo = static_cast + (mMediaResolver->CreateMediaInfoL(file))); + if (error == KErrNone) + { + TRAP(error, mMediaResolver->ParseInfoDetailsL( + mImageInfo, file)); + } + file.Close(); } - - file.Close(); delete name; } - + if (error == KErrNone) { mSavedImageFile = imagefile; @@ -263,6 +278,7 @@ mImageFile.clear(); setImage(false); //Show appropriate note and leave + showInsertFailureNote(); return; } @@ -274,7 +290,7 @@ HbStyle::setItemName(mIconItem, "pixmap"); mIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); - mIconItem->installSceneEventFilter(mGestureFilter); + // mIconItem->installSceneEventFilter(mGestureFilter); // repolish the body widget this->repolish(); @@ -298,7 +314,6 @@ mAudioSize = 0; } - //TODO: Add conformance checks before calculating the size int msgSize = messageSize(); QFileInfo fileinfo(mAudioFile); int audioSize = fileinfo.size() + KEstimatedMimeHeaderSize; @@ -311,6 +326,7 @@ mAudioFile.clear(); setAudio(false); //Show appropriate note and leave + showInsertFailureNote(); return; } @@ -332,38 +348,6 @@ emit contentChanged(); } -void MsgUnifiedEditorBody::setVideo(QString& videofile) -{ - //check for insert conformance - if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(videofile)) - return; - - // update the media file-list - mVideoFile = videofile; - - //TODO: Add conformance checks before calculating the size - int msgSize = messageSize(); - QFileInfo fileinfo(mVideoFile); - int videoSize = fileinfo.size() + KEstimatedMimeHeaderSize; - if((videoSize + msgSize) <= MsgMonitor::maxMmsSize() ) - { - mVideoSize = videoSize; - } - else - { - //Show appropriate note and leave - return; - } - - //TODO: create video item instance - - // repolish the body widget - this->repolish(); - - // emit signal to indicate addition of video - emit contentChanged(); -} - void MsgUnifiedEditorBody::setText(QString& text) { mTextEdit->setPlainText(text); @@ -387,9 +371,12 @@ QSizeF MsgUnifiedEditorBody::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { QSizeF szHint = HbWidget::sizeHint(which,constraint); - - QList windowList = hbInstance->allMainWindows(); - HbMainWindow* mMainWindow = windowList[0]; + + HbMainWindow* mMainWindow = this->mainWindow(); + if(!mMainWindow) + { + return szHint; + } qreal leftMargin = 0.0; qreal rightMargin = 0.0; @@ -440,7 +427,7 @@ mAudioItem->show(); } - if(mIconItem) + if(mIconItem || mProcessingWidget) { QSizeF imageSize(0.0,0.0); QSizeF defaultImageSize(QImageReader(mImageFile).size()); @@ -474,6 +461,8 @@ imageSize.setWidth(newWidth); } + if(mIconItem) + { mIconItem->setPreferredSize(imageSize); mIconItem->setSize(imageSize); if(mMainWindow->orientation() == Qt::Horizontal) @@ -483,9 +472,18 @@ mIconItem->setPos(currPos); } mIconItem->show(); + } + + if(mProcessingWidget) + { + imageSize.setHeight(mProcessingWidget->preferredHeight()); + mProcessingWidget->setPreferredSize(imageSize); + mProcessingWidget->show(); + } szHint.rheight() += imageSize.height(); } } + mTextEdit->setMinimumHeight(maxHeight); szHint.rheight() += bodyItemSpacing; @@ -516,7 +514,7 @@ mImageFile.clear(); if(mIconItem) { - mIconItem->removeSceneEventFilter(mGestureFilter); + // mIconItem->removeSceneEventFilter(mGestureFilter); delete mIconItem; mIconItem = NULL; } @@ -709,17 +707,28 @@ void MsgUnifiedEditorBody::onTextChanged() { QString string = text(); - - if( !mPrevBuffer.isEmpty() && - string.size() > mPrevBuffer.size() && - MsgMonitor::messageType() == ConvergedMessage::Mms ) + + if( string.size() > mPrevBuffer.size() && + MsgMonitor::messageType() == ConvergedMessage::Mms ) { - //Save the previous buffer - mPrevBuffer = string; - // emit signal to indicate change in content - emit contentChanged(); - - return; + // reject any text input if mms size limit is reached + int futureSize = bodySize() + + MsgMonitor::containerSize() + MsgMonitor::subjectSize(); + if(futureSize > MsgMonitor::maxMmsSize()) + { + mTextEdit->setPlainText(mPrevBuffer); + HbNotificationDialog::launchDialog(LOC_UNABLE_TO_ADD_CONTENT); + mTextEdit->setCursorPosition(mPrevBuffer.length()); + return; + } + else if(!mPrevBuffer.isEmpty()) + { + //Save the previous buffer + mPrevBuffer = string; + // emit signal to indicate change in content + emit contentChanged(); + return; + } } //Check done for optimization @@ -789,33 +798,36 @@ void MsgUnifiedEditorBody::startResizeAnimation() { - HbIconAnimationManager *manager = HbIconAnimationManager::global(); - bool defined = manager->addDefinitionFile(":/animation.axml"); - - HbIcon animIcon; - animIcon.setIconName("frame_anim_looping"); - - mIconItem = new HbIconItem(this); - mIconItem->hide(); - HbStyle::setItemName(mIconItem,"pixmap"); - mIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); - mIconItem->setIcon(animIcon); - - mImageFile = ANIMATION_ICON; - HbIconAnimator animator; - animator.setIcon(animIcon); - - animator.startAnimation(); - this->repolish(); + QGraphicsLinearLayout* processingLayout = new QGraphicsLinearLayout(Qt::Vertical); + + mProcessingWidget = new HbWidget(this); + HbStyle::setItemName(mProcessingWidget,"pixmap"); + mProcessingWidget->hide(); + mProcessingWidget->setLayout(processingLayout); + + HbTextItem* processingText = new HbTextItem(LOC_PROCESSING,mProcessingWidget); + processingText->setAlignment(Qt::AlignCenter); + processingLayout->addItem(processingText); + + HbIconItem* animationItem = new HbIconItem(ANIMATION_ICON,mProcessingWidget); + processingLayout->addItem(animationItem); + + HbIconAnimator& iconAnimator = animationItem->animator(); + HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global(); + iconAnimationManager->addDefinitionFile(ANIMATION_FILE); + + iconAnimator.startAnimation(); + + this->repolish(); } void MsgUnifiedEditorBody::stopResizeAnimation() { - if (mIconItem) + if(mProcessingWidget) { - delete mIconItem; - mIconItem = NULL; - } + delete mProcessingWidget; + mProcessingWidget = NULL; + } } // --------------------------------------------------------- @@ -857,4 +869,12 @@ Q_UNUSED(errorCode) } +//--------------------------------------------------------------- +// MsgUnifiedEditorBody :: setFocus +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorBody::setFocus() +{ + mTextEdit->setFocus(Qt::MouseFocusReason); +} // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp Fri May 14 15:49:35 2010 +0300 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include "msgmonitor.h" @@ -77,11 +78,10 @@ // --------------------------------------------------------- // CUniEditorProcessImageOperation* CUniEditorProcessImageOperation::NewL( - MUniEditorProcessImageOperationObserver &aObserver, - RFs& aFs ) + MUniEditorProcessImageOperationObserver &aObserver) { CUniEditorProcessImageOperation* self = new ( ELeave ) - CUniEditorProcessImageOperation(aObserver,aFs ); + CUniEditorProcessImageOperation(aObserver); CleanupStack::PushL( self ); self->ConstructL(); @@ -95,10 +95,9 @@ // --------------------------------------------------------- // CUniEditorProcessImageOperation::CUniEditorProcessImageOperation( - MUniEditorProcessImageOperationObserver &aObserver, - RFs& aFs ) : CActive( EPriorityStandard ), - iObserver(aObserver), - iFs( aFs ) + MUniEditorProcessImageOperationObserver &aObserver) + : CActive( EPriorityStandard ), + iObserver(aObserver) { CActiveScheduler::Add( this ); } @@ -111,6 +110,8 @@ // void CUniEditorProcessImageOperation::ConstructL() { + User::LeaveIfError(iFs.Connect()); + iFs.ShareProtected(); TInt featureBitmask( 0 ); @@ -164,9 +165,13 @@ delete iImageProcessor; //Since iFs doesnot have recursive dir deletion use file manager - CFileMan *fm = CFileMan::NewL(iFs); - fm->RmDir(KTempFilePath); - delete fm; + TRAP_IGNORE( + CFileMan *fm = CFileMan::NewL(iFs); + fm->RmDir(KTempFilePath); + delete fm; + ); + + iFs.Close(); } // --------------------------------------------------------- @@ -269,7 +274,7 @@ { iOperationState = EUniProcessImgProcess; } - CompleteSelf( KErrNone ); + checkLargeImage(); } // --------------------------------------------------------- @@ -312,6 +317,7 @@ //Delete the previous object if present delete iNewImageInfo; + iNewImageInfo = NULL; iNewImageInfo = static_cast(mediaResolver->CreateMediaInfoL( iNewImageFile ) ); mediaResolver->ParseInfoDetailsL( iNewImageInfo, iNewImageFile ); @@ -408,11 +414,14 @@ { iProcessMethod = EUniProcessImgMethodNone; - CMmsConformance* mmsConformance = CMmsConformance::NewL(); - mmsConformance->CheckCharacterSet( EFalse ); - - TMmsConformance conformance = - mmsConformance->MediaConformance( *iImageInfo ); + CMmsConformance* mmsConformance = NULL; + TRAP_IGNORE(mmsConformance = CMmsConformance::NewL()); + TMmsConformance conformance; + if(mmsConformance) + { + mmsConformance->CheckCharacterSet( EFalse ); + conformance = mmsConformance->MediaConformance( *iImageInfo ); + } if ( conformance.iCanAdapt == EFalse ) { @@ -477,7 +486,7 @@ iProcessMethod |= EUniProcessImgMethodCompress; } - TBool largeImageQuery = EFalse; + largeImageQuery = EFalse; if ( iProcessMethod == EUniProcessImgMethodNone ) { @@ -501,20 +510,30 @@ largeImageQuery = ETrue; } } + + iScaleSize = scaleSize; + return ETrue; + } +// --------------------------------------------------------- +// CUniEditorProcessImageOperation::checkLargeImage +// --------------------------------------------------------- +// +void CUniEditorProcessImageOperation::checkLargeImage() +{ //Large image query if( largeImageQuery && iMmsCreationMode == EMmsCreationModeWarning) { - if(!HbMessageBox::question(LOC_LARGE_IMAGE_NOTE)) - { - return EFalse; // Abort - } - + HbMessageBox::question(LOC_LARGE_IMAGE_NOTE, this, + SLOT(onDialogLargeImage(HbAction*))); + } + else + { + CompleteSelf(KErrNone); } - iScaleSize = scaleSize; - return ETrue; - } +} + // --------------------------------------------------------- // CUniEditorProcessImageOperation::CreateEmptyAttachmentL @@ -676,5 +695,17 @@ } } +// --------------------------------------------------------- +// CUniEditorProcessImageOperation::onDialogLargeImage +// --------------------------------------------------------- +// +void CUniEditorProcessImageOperation::onDialogLargeImage(HbAction* action) + { + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(1)) { + iOperationState = EUniProcessImgError; + } + CompleteSelf(KErrNone); + } // End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Fri May 14 15:49:35 2010 +0300 @@ -18,14 +18,17 @@ // INCLUDES #include "debugtraces.h" #include +#include // USER INCLUDES #include "msgunieditorsubject.h" #include "UniEditorGenUtils.h" #include "msgunifiededitorlineedit.h" +#include "msgmonitor.h" // Localized Constants #define LOC_SUBJECT hbTrId("txt_messaging_formlabel_subject") +#define LOC_UNABLE_TO_ADD_CONTENT hbTrId("txt_messaging_dpopinfo_unable_to_add_more_content") //priority icon const QString HIGH_PRIORITY("qtg_small_priority_high"); @@ -35,19 +38,12 @@ // MsgUnifiedEditorSubject::MsgUnifiedEditorSubject // @see header file //--------------------------------------------------------------- -MsgUnifiedEditorSubject::MsgUnifiedEditorSubject( const QString& pluginPath, QGraphicsItem *parent ) : -HbWidget(parent), -mPluginPath(pluginPath), +MsgUnifiedEditorSubject::MsgUnifiedEditorSubject( QGraphicsItem *parent ) : +MsgUnifiedEditorBaseWidget(parent), mPriorityIcon(NULL), mPriority(ConvergedMessage::Normal), mGenUtils(0) { -#ifdef _DEBUG_TRACES_ - qDebug() << "MsgUnifiedEditorSubject calling HbStyle::registerPlugin"; -#endif - - setPluginBaseId(style()->registerPlugin(mPluginPath)); - mSubjectEdit = new MsgUnifiedEditorLineEdit(LOC_SUBJECT,this); mSubjectEdit->setDefaultBehaviour(true); HbStyle::setItemName(mSubjectEdit,"subjectEdit"); @@ -57,7 +53,7 @@ mGenUtils = new UniEditorGenUtils(); connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); + this, SLOT(onContentsChanged(const QString&))); } //--------------------------------------------------------------- @@ -66,8 +62,6 @@ //--------------------------------------------------------------- MsgUnifiedEditorSubject::~MsgUnifiedEditorSubject() { - style()->unregisterPlugin(mPluginPath); - if(mGenUtils) { delete mGenUtils; @@ -117,33 +111,28 @@ return mPriority; } -void MsgUnifiedEditorSubject::onContentsAdded(const QString& text) +void MsgUnifiedEditorSubject::onContentsChanged(const QString& text) { - if(!text.isEmpty()) + // reject any text input if mms size limit is reached + int futureSize = subjectSize() + + MsgMonitor::containerSize() + MsgMonitor::bodySize(); + if(futureSize > MsgMonitor::maxMmsSize()) { + // atomic operation disconnect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); - if(!subjectOkInSms()) - { - emit contentChanged(); - } + this, SLOT(onContentsChanged(const QString&))); + mSubjectEdit->clearContent(); + mSubjectEdit->setText(mPrevBuffer); connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsRemoved(const QString&))); + this, SLOT(onContentsChanged(const QString&))); + HbNotificationDialog::launchDialog(LOC_UNABLE_TO_ADD_CONTENT); + return; } -} -void MsgUnifiedEditorSubject::onContentsRemoved(const QString& text) -{ - if(text.isEmpty()) + mPrevBuffer = text; + if(!subjectOkInSms()) { - disconnect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsRemoved(const QString&))); - if(!subjectOkInSms()) - { - emit contentChanged(); - } - connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), - this, SLOT(onContentsAdded(const QString&))); + emit contentChanged(); } } @@ -165,4 +154,9 @@ mSubjectEdit->setText(text); } +void MsgUnifiedEditorSubject::setFocus() +{ + mSubjectEdit->setFocus(Qt::MouseFocusReason); +} + //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Fri May 14 15:49:35 2010 +0300 @@ -36,10 +36,13 @@ #include #include #include +#include +#include #include #include - +#include // QT Mobility for fetching business card +#include #include #include #include @@ -47,6 +50,7 @@ #include #include + // USER INCLUDES #include "debugtraces.h" #include "msgunieditorview.h" @@ -60,7 +64,9 @@ #include "unieditorgenutils.h" #include "unieditorpluginloader.h" #include "unieditorplugininterface.h" +#include "msgsettingsview.h" +QTM_USE_NAMESPACE // Constants const QString SEND_ICON("qtg_mono_send"); const QString ATTACH_ICON("qtg_mono_attach"); @@ -109,11 +115,30 @@ #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") #define LOC_DIALOG_OK hbTrId("txt_common_button_ok") +// attachment addition failure note +#define LOC_UNABLE_TO_ADD_ATTACHMENTS hbTrId("txt_messaging_dpopinfo_unable_to_attach_l1_of_l2") + //extension list item frame. const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal"); +//settings confirmation +#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_settings_incomplete") +#define LOC_DIALOG_MMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_mms_settings_incomplete") // LOCAL FUNCTIONS -QString editorTempPath(); + +//--------------------------------------------------------------- +// editorTempPath +// @return fullPath of unified editor's temporary dir +//--------------------------------------------------------------- +QString editorTempPath() +{ + QDir tempDir; + QString tempPath(QDir::toNativeSeparators(tempDir.tempPath())); + tempPath.append(QDir::separator()); + tempPath.append(UNIFIED_EDITOR_TEMP_FOLDER); + tempPath.append(QDir::separator()); + return tempPath; +} //--------------------------------------------------------------- // MsgUnifiedEditorView::MsgUnifiedEditorView @@ -133,19 +158,40 @@ mMsgMonitor(0), mAttachmentContainer(0), mPluginLoader(0), - mCanSaveToDrafts(true) + mCanSaveToDrafts(true), + mVkbHost(NULL) { - addMenu(); + connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); + addToolBar(); + initView(); + } +//--------------------------------------------------------------- +// MsgUnifiedEditorView::~MsgUnifiedEditorView +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorView::~MsgUnifiedEditorView() +{ + // clean editor's temporary contents before exiting + removeTempFolder(); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::initView +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorView::initView() +{ + if (!HbStyleLoader::registerFilePath(":/layouts")) { + QDEBUG_WRITE("ERROR: MsgUnifiedEditorView -> HbStyleLoader::registerFilePath"); + } HbScrollArea* scrollArea = new HbScrollArea(this); this->setWidget(scrollArea); mContentWidget = new HbWidget(this); scrollArea->setContentWidget(mContentWidget); - mPluginPath = pluginPath(); - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, mContentWidget); qreal vTopSpacing = 0.0; qreal vItemSpacing = 0.0; @@ -157,8 +203,9 @@ mMsgMonitor = new MsgMonitor(this); - mToField = new MsgUnifiedEditorAddress( LOC_TO, mPluginPath, mContentWidget ); - mBody = new MsgUnifiedEditorBody(mPluginPath, mContentWidget); + mToField = new MsgUnifiedEditorAddress( LOC_TO, mContentWidget ); + + mBody = new MsgUnifiedEditorBody( mContentWidget); mMainLayout->addItem(mToField); mMainLayout->addItem(mBody); @@ -166,55 +213,34 @@ //Set the invalid msg id mOpenedMessageId.setId(-1); - // create editor's temp folder - QDir tempDir = QDir(QString()); - QString tempPath(editorTempPath()); - if(tempDir.mkpath(tempPath)) - { - tempDir.cd(tempPath); - // remove stale folder content when freshly launched - QStringList contentList(tempDir.entryList()); - int contentCount = contentList.count(); - for(int i=0; iaddAction(LOC_ADD_SUBJECT); - mCcBccAction = mainMenu->addAction(LOC_ADD_CC_BCC); + mainMenu->setFocusPolicy(Qt::NoFocus); + + //if subject field / cc,bcc fields are already present don't add corresponding actions. + if(!mSubjectField) + { + mSubjectAction = mainMenu->addAction(LOC_ADD_SUBJECT); + } + + if(!mCcField) + { + mCcBccAction = mainMenu->addAction(LOC_ADD_CC_BCC); + } HbMenu* prioritySubMenu = mainMenu->addMenu(LOC_PRIORITY); @@ -274,6 +300,8 @@ populateContentIntoEditor(*msg); delete msg; } + + mCanSaveToDrafts = false; } void MsgUnifiedEditorView::forwardMessage(ConvergedMessageId& messageId, @@ -328,14 +356,10 @@ // population logic based on editor Operation command switch(editorOp) { - case MsgBaseView::ADD_RECIPIENTS: - { - addCcBcc(); - } - break; case MsgBaseView::ADD_SUBJECT: { addSubject(); + setFocus(mSubjectField); } break; case MsgBaseView::ADD_VCARD: @@ -355,7 +379,36 @@ // additional common operations for non-forwarded messages if(editorOp != MsgBaseView::FORWARD_MSG) { - mToField->setAddresses(messageDetails->toAddressList()); + if(editorOp == MsgBaseView::ADD_RECIPIENTS) + { + // CV sends contact card address as the first address + ConvergedMessageAddressList toAddresses = + messageDetails->toAddressList(); + int addrCount = toAddresses.count(); + if(addrCount > 0) + { + // add contact card address first + ConvergedMessageAddress *firstAddress = + new ConvergedMessageAddress(); + firstAddress->setAlias(toAddresses.at(0)->alias()); + firstAddress->setAddress(toAddresses.at(0)->address()); + ConvergedMessageAddressList firstList; + firstList << firstAddress; + mToField->setAddresses(firstList); + + // add remaining contacts now + ConvergedMessageAddressList otherList; + for(int i=1; isetAddresses(otherList); + } + } + else + { + mToField->setAddresses(messageDetails->toAddressList()); + } QString bodyTxt = messageDetails->bodyText(); mBody->setText(bodyTxt); @@ -376,19 +429,11 @@ case EMsgMediaImage: { mBody->setImage(filePath); - addSubject(); } break; - case EMsgMediaVideo: - { - mBody->setVideo(filePath); - addSubject(); - } - break; - case EMsgMediaAudio: + case EMsgMediaAudio: { mBody->setAudio(filePath); - addSubject(); } break; default: @@ -401,7 +446,7 @@ // add pending attachments in bulk addAttachments(pendingAttList); } - delete messageDetails; + delete messageDetails; } void MsgUnifiedEditorView::populateContentIntoEditor( @@ -409,6 +454,8 @@ { // skip first-time MMS type switch note for draft mMsgMonitor->setSkipNote(true); + mToField->skipMaxRecipientQuery(true); + mToField->setAddresses(messageDetails.toAddressList()); if(messageDetails.ccAddressList().count() > 0 ) { @@ -473,19 +520,11 @@ case EMsgMediaImage: { mBody->setImage(filePath); - addSubject(); - break; - } - case EMsgMediaVideo: - { - mBody->setVideo(filePath); - addSubject(); break; } case EMsgMediaAudio: { mBody->setAudio(filePath); - addSubject(); break; } default: @@ -505,6 +544,7 @@ delete genUtils; // ensure that any msg-type change after this are shown + mToField->skipMaxRecipientQuery(false); mMsgMonitor->setSkipNote(false); } @@ -519,20 +559,21 @@ HbAction *attachAction = toolBar->addExtension(attachExtension); attachAction->setIcon(HbIcon(ATTACH_ICON)); - HbListWidget* extnList = new HbListWidget(); - extnList->addItem(LOC_PHOTO); - extnList->addItem(LOC_SOUND); - extnList->addItem(LOC_BUSINESS_CARD); + mTBExtnContentWidget = new HbListWidget(); + mTBExtnContentWidget->addItem(LOC_PHOTO); + mTBExtnContentWidget->addItem(LOC_SOUND); + mTBExtnContentWidget->addItem(LOC_BUSINESS_CARD); - HbListViewItem *prototype = extnList->listItemPrototype(); + HbListViewItem *prototype = mTBExtnContentWidget->listItemPrototype(); HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces); prototype->setDefaultFrame(frame); - connect(extnList, SIGNAL(activated(HbListWidgetItem*)), this, - SLOT(handleViewExtnActivated(HbListWidgetItem*))); - connect(extnList, SIGNAL(activated(HbListWidgetItem*)), attachExtension, SLOT(close())); + connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)), + this, SLOT(handleViewExtnActivated(HbListWidgetItem*))); + connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)), + attachExtension, SLOT(close())); - attachExtension->setContentWidget(extnList); + attachExtension->setContentWidget(mTBExtnContentWidget); //Add Action to the toolbar and show toolbar toolBar->addAction(HbIcon(SEND_ICON),QString(),this,SLOT(send())); @@ -547,11 +588,6 @@ { // do nothing if already present return; } - // remove mainmenu's "Add Subject" action - HbMenu* mainMenu = this->menu(); - mainMenu->removeAction(mSubjectAction); - mSubjectAction->setParent(NULL); - delete mSubjectAction; int index =0; int offset = 1; @@ -561,10 +597,28 @@ } index = mMainLayout->count() - offset; - mSubjectField = new MsgUnifiedEditorSubject(mPluginPath, mContentWidget); + mSubjectField = new MsgUnifiedEditorSubject( mContentWidget); + mMainLayout->insertItem(index,mSubjectField); connect(mSubjectField, SIGNAL(contentChanged()), - mMsgMonitor, SLOT(checkMsgTypeChange())); + mMsgMonitor, SLOT(handleContentChange())); + connect(mSubjectField, SIGNAL(contentChanged()),this,SLOT(onContentChanged())); + + //set focus to subject field. + HbAction* subjectAction = qobject_cast(this->sender()); + if(subjectAction) + { + setFocus(mSubjectField); + } + + // remove mainmenu's "Add Subject" action + if(mSubjectAction) + { + HbMenu* mainMenu = this->menu(); + mainMenu->removeAction(mSubjectAction); + mSubjectAction->setParent(NULL); + delete mSubjectAction; + } } void MsgUnifiedEditorView::addCcBcc() @@ -574,19 +628,18 @@ return; } - // remove mainmenu's "Add Cc/Bcc" & "Add Subject" actions - HbMenu* mainmenu = this->menu(); - mainmenu->removeAction(mCcBccAction); - mCcBccAction->setParent(NULL); - delete mCcBccAction; - - mCcField = new MsgUnifiedEditorAddress( LOC_CC, mPluginPath, mContentWidget ); - mBccField = new MsgUnifiedEditorAddress( LOC_BCC, mPluginPath, mContentWidget ); + mCcField = new MsgUnifiedEditorAddress( LOC_CC, mContentWidget ); + mBccField = new MsgUnifiedEditorAddress( LOC_BCC, mContentWidget ); + mCcField->skipMaxRecipientQuery(true); + mBccField->skipMaxRecipientQuery(true); connect(mCcField, SIGNAL(sendMessage()), this, SLOT(send())); - connect(mCcField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(checkMsgTypeChange())); + connect(mCcField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(handleContentChange())); + connect(mCcField, SIGNAL(contentChanged()),this,SLOT(onContentChanged())); + connect(mBccField, SIGNAL(sendMessage()), this, SLOT(send())); - connect(mBccField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(checkMsgTypeChange())); + connect(mBccField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(handleContentChange())); + connect(mBccField, SIGNAL(contentChanged()),this,SLOT(onContentChanged())); HbWidget* groupWidget = new HbWidget(mContentWidget); groupWidget->setContentsMargins(0,0,0,0); @@ -610,6 +663,22 @@ // add subject field too addSubject(); + + //set focus to Cc field. + HbAction* ccBccAction = qobject_cast(this->sender()); + if(mCcBccAction) + { + setFocus(mCcField); + } + + // remove mainmenu's "Add Cc/Bcc" & "Add Subject" actions + if(mCcBccAction) + { + HbMenu* mainmenu = this->menu(); + mainmenu->removeAction(mCcBccAction); + mCcBccAction->setParent(NULL); + delete mCcBccAction; + } this->updateGeometry(); } @@ -653,34 +722,8 @@ void MsgUnifiedEditorView::deleteMessage() { - bool ok = HbMessageBox::question(LOC_NOTE_DELETE_MESSAGE, + HbMessageBox::question(LOC_NOTE_DELETE_MESSAGE,this,SLOT(onDialogDeleteMsg(HbAction*)), LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - - if(ok) - { - mCanSaveToDrafts = false; - - //delete if draft entry opened - if( mOpenedMessageId.getId() != -1) - { - if(!mPluginLoader) - { - mPluginLoader = new UniEditorPluginLoader(this); - } - - UniEditorPluginInterface* pluginInterface = - mPluginLoader->getUniEditorPlugin(MsgMonitor::messageType()); - - pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId()); - } - - //trigger back action. - HbAction* backAction = this->navigationAction(); - if(backAction) - { - backAction->trigger(); - } - } } void MsgUnifiedEditorView::removeAttachmentContainer() @@ -700,30 +743,29 @@ int i=0; for(i=0; icount() - 1; mMainLayout->insertItem(index,mAttachmentContainer); } @@ -737,37 +779,31 @@ removeAttachmentContainer(); } } - else if(mAttachmentContainer->hasMMContent()) - { - // when msg is converted to MMS, subject needs to be auto-inserted - addSubject(); - } return ret; } -QString MsgUnifiedEditorView::pluginPath() -{ - QString pluginPath; - #ifdef Q_OS_WIN - #define PLUGINPATH "../unifiededitorplugin/debug/unifiededitorplugind.dll" - #endif - #ifdef Q_OS_SYMBIAN - #define PLUGINPATH "unifiededitorplugin.dll" - #endif - pluginPath.append(PLUGINPATH); - return pluginPath; -} - void MsgUnifiedEditorView::send() { activateInputBlocker(); + + // first run the address validation tests + if( !mToField->validateContacts() || + (mCcField && !mCcField->validateContacts()) || + (mBccField && !mBccField->validateContacts()) ) + { + deactivateInputBlocker(); + return; + } // converged msg for sending ConvergedMessage msg; ConvergedMessage::MessageType messageType = MsgMonitor::messageType(); msg.setMessageType(messageType); - ConvergedMessageAddressList addresses = mToField->addresses(); + // we need to remove duplicate addresses + bool removeDuplicates = true; + ConvergedMessageAddressList addresses = + mToField->addresses(removeDuplicates); if(messageType == ConvergedMessage::Sms && addresses.isEmpty()) { @@ -780,11 +816,11 @@ ConvergedMessageAddressList bccAddresses; if(mCcField) { - ccAddresses = mCcField->addresses(); + ccAddresses = mCcField->addresses(removeDuplicates); } if(mBccField) { - bccAddresses = mBccField->addresses(); + bccAddresses = mBccField->addresses(removeDuplicates); } if( messageType == ConvergedMessage::Mms && addresses.isEmpty() && @@ -795,6 +831,9 @@ deactivateInputBlocker(); return; } + + //close vkb before switching view. + mVkbHost->closeKeypad(true); packMessage(msg); @@ -849,8 +888,7 @@ receipient = addrList.at(0)->address(); } } - - + QVariantList params; if(recepientCount == 1 ) @@ -873,26 +911,33 @@ deactivateInputBlocker(); if(sendResult == KErrNotFound) { - bool result = HbMessageBox::question("Settings not defined\nDefine now ?", - LOC_DIALOG_OK, - LOC_BUTTON_CANCEL); - if (result) + if (messageType == ConvergedMessage::Sms) { - QVariantList params; - params << MsgBaseView::MSGSETTINGS;// target view - params << MsgBaseView::UNIEDITOR; // source view - emit switchView(params); + HbMessageBox::question(LOC_DIALOG_SMS_SETTINGS_INCOMPLETE, + this,SLOT(onDialogSmsSettings(HbAction*)), + LOC_DIALOG_OK, + LOC_BUTTON_CANCEL); + } + else + { + HbMessageBox::question(LOC_DIALOG_MMS_SETTINGS_INCOMPLETE, + this,SLOT(onDialogMmsSettings(HbAction*)), + LOC_DIALOG_OK, + LOC_BUTTON_CANCEL); } } } } -void MsgUnifiedEditorView::packMessage(ConvergedMessage &msg) +void MsgUnifiedEditorView::packMessage(ConvergedMessage &msg, bool isSave) { ConvergedMessage::MessageType messageType = MsgMonitor::messageType(); msg.setMessageType(messageType); - - ConvergedMessageAddressList addresses = mToField->addresses(); + // If isSave is true (save to draft usecase), then don't remove duplicates + // If isSave is false (send usecase), then remove duplicates + bool removeDuplicates = !isSave; + ConvergedMessageAddressList addresses = + mToField->addresses(removeDuplicates); ConvergedMessageAddressList ccAddresses; ConvergedMessageAddressList bccAddresses; @@ -906,47 +951,50 @@ { if(mCcField) { - ccAddresses = mCcField->addresses(); + ccAddresses = mCcField->addresses(removeDuplicates); } if(mBccField) { - bccAddresses = mBccField->addresses(); + bccAddresses = mBccField->addresses(removeDuplicates); } - int matchDigitsCount = MsgUnifiedEditorAddress::contactMatchDigits(); - //comapre cc and to field,remove duplicate from cc - foreach(ConvergedMessageAddress *ccAddress,ccAddresses) - { - foreach(ConvergedMessageAddress *toAddress,addresses) - { - if(0 == ccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount))) - { - ccAddresses.removeOne(ccAddress); - } - } - } - //comapre bcc and cc field,remove duplicate from bcc - foreach(ConvergedMessageAddress *bccAddress,bccAddresses) + if(removeDuplicates) { - foreach(ConvergedMessageAddress *ccAddress,ccAddresses) - { - if(0 == bccAddress->address().right(matchDigitsCount).compare(ccAddress->address().right(matchDigitsCount))) - { - bccAddresses.removeOne(bccAddress); - } - } - } - //comapre bcc and to field,remove duplicate from bcc - foreach(ConvergedMessageAddress *bccAddress,bccAddresses) - { - foreach(ConvergedMessageAddress *toAddress,addresses) - { - if(0 == bccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount))) - { - bccAddresses.removeOne(bccAddress); - } - } + int matchDigitsCount = MsgUnifiedEditorAddress::contactMatchDigits(); + //comapre cc and to field,remove duplicate from cc + foreach(ConvergedMessageAddress *ccAddress,ccAddresses) + { + foreach(ConvergedMessageAddress *toAddress,addresses) + { + if(0 == ccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount))) + { + ccAddresses.removeOne(ccAddress); + } + } + } + //comapre bcc and cc field,remove duplicate from bcc + foreach(ConvergedMessageAddress *bccAddress,bccAddresses) + { + foreach(ConvergedMessageAddress *ccAddress,ccAddresses) + { + if(0 == bccAddress->address().right(matchDigitsCount).compare(ccAddress->address().right(matchDigitsCount))) + { + bccAddresses.removeOne(bccAddress); + } + } + } + //comapre bcc and to field,remove duplicate from bcc + foreach(ConvergedMessageAddress *bccAddress,bccAddresses) + { + foreach(ConvergedMessageAddress *toAddress,addresses) + { + if(0 == bccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount))) + { + bccAddresses.removeOne(bccAddress); + } + } + } } if(ccAddresses.count()>0) @@ -1077,7 +1125,7 @@ return; } ConvergedMessage msg; - packMessage(msg); + packMessage(msg, true); // save to drafts MsgSendUtil *sendUtil = new MsgSendUtil(this); @@ -1113,20 +1161,6 @@ } //--------------------------------------------------------------- -// editorTempPath -// @return fullPath of unified editor's temporary dir -//--------------------------------------------------------------- -QString editorTempPath() -{ - QDir tempDir = QDir(QString()); - QString tempPath(QDir::toNativeSeparators(tempDir.tempPath())); - tempPath.append(QDir::separator()); - tempPath.append(UNIFIED_EDITOR_TEMP_FOLDER); - tempPath.append(QDir::separator()); - return tempPath; -} - -//--------------------------------------------------------------- // MsgUnifiedEditorView::createVCards // @see header file //--------------------------------------------------------------- @@ -1134,13 +1168,10 @@ const QVariant& value, QStringList& filelist) { // make sure that temp-folder is created for storing vcards - QDir tempDir = QDir(QString()); - if(!tempDir.mkpath(editorTempPath())) + if(!createTempFolder()) { return KErrGeneral; } - tempDir.cd(editorTempPath()); - // extract contact-list QContactManager* contactManager = new QContactManager("symbian"); @@ -1216,7 +1247,7 @@ //--------------------------------------------------------------- QString MsgUnifiedEditorView::generateFileName(QString& suggestedName) { - QDir editorTempDir = QDir(QString()); + QDir editorTempDir; editorTempDir.cd(editorTempPath()); for(int i=0; isetSynchronous(true); // synchronous if(!request) { QCRITICAL_WRITE("AIW-ERROR: NULL request"); @@ -1340,7 +1372,12 @@ this, SLOT(imagesFetched(const QVariant&))); connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(serviceRequestError(int,const QString&))); - + + // Set arguments for request + QList args; + args << QVariantMap(); + args << QVariant(); + request->setArguments(args); // Make the request if (!request->send()) { @@ -1355,12 +1392,13 @@ //--------------------------------------------------------------- void MsgUnifiedEditorView::fetchAudio() { - QString service("Music Fetcher"); - QString interface("com.nokia.services.media.Music"); - QString operation("fetch(QString)"); + QString service("musicplayer"); + QString interface("com.nokia.symbian.IMusicFetch"); + QString operation("fetch()"); XQAiwRequest* request = NULL; XQApplicationManager appManager; request = appManager.create(service, interface, operation, true); //embedded + request->setSynchronous(true); // synchronous if(!request) { QCRITICAL_WRITE("AIW-ERROR: NULL request"); @@ -1407,7 +1445,6 @@ { QString filepath(QDir::toNativeSeparators(fileList.at(0))); mBody->setImage(filepath); - addSubject(); } } } @@ -1426,7 +1463,6 @@ QString filepath(QDir::toNativeSeparators(fileList.at(0))); QDEBUG_WRITE_FORMAT("Received audio file path = ", fileList.at(0)); mBody->setAudio(filepath); - addSubject(); } } } @@ -1445,19 +1481,207 @@ // @see header file //-------------------------------------------------------------- void MsgUnifiedEditorView::activateInputBlocker() - { - this->grabMouse(); - this->grabKeyboard(); - } +{ + this->grabMouse(); + this->grabKeyboard(); +} //--------------------------------------------------------------- // MsgUnifiedEditorView::deactivateInputBlocker // @see header file //-------------------------------------------------------------- void MsgUnifiedEditorView::deactivateInputBlocker() - { - this->ungrabKeyboard(); - this->ungrabMouse(); +{ + this->ungrabKeyboard(); + this->ungrabMouse(); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::setAttachOptionEnabled +// @see header file +//-------------------------------------------------------------- +void MsgUnifiedEditorView::setAttachOptionEnabled( + MsgUnifiedEditorView::TBE_AttachOption opt, bool enable) +{ + HbListWidgetItem* wgtItem = mTBExtnContentWidget->item(opt); + wgtItem->setEnabled(enable); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::vkbOpened +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorView::vkbOpened() +{ + hideChrome(true); + + disconnect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened())); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::vkbClosed +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorView::vkbClosed() +{ + hideChrome(false); + + connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened())); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::hideChrome +// +//--------------------------------------------------------------- +void MsgUnifiedEditorView::hideChrome(bool hide) +{ + if(hide) + { + this->setContentFullScreen(true); + this->hideItems(Hb::StatusBarItem | Hb::TitleBarItem); + } + else + { + this->setContentFullScreen(false); + this->showItems(Hb::StatusBarItem | Hb::TitleBarItem); } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::doDelayedConstruction +// +//--------------------------------------------------------------- +void MsgUnifiedEditorView::doDelayedConstruction() +{ + addMenu(); + createTempFolder(); + + //Create VKB instance and listen to VKB open and close signals. + mVkbHost = new HbAbstractVkbHost(this); + connect(mVkbHost, SIGNAL(keypadOpened()), this, SLOT(vkbOpened())); + connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(vkbClosed())); + + disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); + +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::createTempFolder +// +//--------------------------------------------------------------- +bool MsgUnifiedEditorView::createTempFolder() +{ + // create editor's temp folder + QDir tempDir; + QString tempPath(editorTempPath()); + bool result = tempDir.mkpath(tempPath); + return result; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::removeTempFolder +// +//--------------------------------------------------------------- +void MsgUnifiedEditorView::removeTempFolder() +{ + QDir tempDir; + QString tempPath(editorTempPath()); + tempDir.cd(tempPath); + QStringList contentList(tempDir.entryList()); + + int contentCount = contentList.count(); + for(int i=0; isetFocus(); + } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::onContentChanged +// +//--------------------------------------------------------------- +void MsgUnifiedEditorView::onContentChanged() +{ + mCanSaveToDrafts = true; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::onDialogDeleteMsg +//--------------------------------------------------------------- +void MsgUnifiedEditorView::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + + mCanSaveToDrafts = false; + + //delete if draft entry opened + if (mOpenedMessageId.getId() != -1) { + if (!mPluginLoader) { + mPluginLoader = new UniEditorPluginLoader(this); + } + + UniEditorPluginInterface* pluginInterface = mPluginLoader->getUniEditorPlugin( + MsgMonitor::messageType()); + + pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId()); + } + + //trigger back action. + HbAction* backAction = this->navigationAction(); + if (backAction) { + backAction->trigger(); + } + + } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::onDialogSmsSettings +//--------------------------------------------------------------- +void MsgUnifiedEditorView::onDialogSmsSettings(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + + QVariantList params; + params << MsgBaseView::MSGSETTINGS;// target view + params << MsgBaseView::UNIEDITOR; // source view + params << MsgSettingsView::SMSView; + emit switchView(params); + + } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorView::onDialogMmsSettings +//--------------------------------------------------------------- +void MsgUnifiedEditorView::onDialogMmsSettings(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + + QVariantList params; + params << MsgBaseView::MSGSETTINGS;// target view + params << MsgBaseView::UNIEDITOR; // source view + params << MsgSettingsView::MMSView; + emit switchView(params); + } +} //EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp Fri May 14 15:49:35 2010 +0300 @@ -151,14 +151,19 @@ //if already selected delete it. if(this->hasSelectedText()) { + // deleting phbkContact is an atomic operation + // ensure that the signal is emitted only once + disconnect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); HbLineEdit::keyPressEvent(event); event->accept(); - //delete seperator (i.e."; "). QKeyEvent eve(event->type(), Qt::Key_Delete, Qt::NoModifier); HbLineEdit::keyPressEvent(&eve); HbLineEdit::keyPressEvent(&eve); - + connect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + onContentsChanged(); } else //make it selected { @@ -171,10 +176,17 @@ QString str = text.right(2); if(str == replacementStr) { + // deleting contact is an atomic operation + // ensure that the signal is emitted only once + disconnect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); //delete seperator (i.e."; "). QKeyEvent eve(event->type(), Qt::Key_Backspace, Qt::NoModifier); HbLineEdit::keyPressEvent(&eve); HbLineEdit::keyPressEvent(&eve); + connect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + onContentsChanged(); } else { @@ -185,7 +197,6 @@ event->accept(); return; - } if (event->key() == Qt::Key_Left ) @@ -358,28 +369,38 @@ event->accept(); } -void MsgUnifiedEditorLineEdit::setText(const QString& text) +void MsgUnifiedEditorLineEdit::setText(const QString& text, bool underlined) { if(!mDefaultBehaviour) { - QInputMethodEvent e; + // atomic operation, ensure one signal only at the end + disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + //make sure previous text is complete. - e.setCommitString(";"); - this->inputMethodEvent(&e); + if(this->content().length() > 0) + { + QInputMethodEvent e; + e.setCommitString(";"); + this->inputMethodEvent(&e); + } this->setCursorPosition(this->text().length()); QTextCursor cursor(this->textCursor()); QTextCharFormat colorFormat(cursor.charFormat()); - QColor fgColor = colorFormat.foreground().color(); - fgColor.setAlpha(fadedAlpha); - colorFormat.setUnderlineColor(fgColor); - - colorFormat.setFontUnderline(true); + if(underlined) + { + QColor fgColor = colorFormat.foreground().color(); + fgColor.setAlpha(fadedAlpha); + colorFormat.setUnderlineColor(fgColor); + colorFormat.setFontUnderline(true); + } cursor.insertText(text , colorFormat); colorFormat.setFontUnderline(false); - cursor.insertText(replacementStr,colorFormat); + cursor.insertText(replacementStr,colorFormat); + connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + onContentsChanged(); } else { @@ -387,8 +408,6 @@ QTextCursor cursor(this->textCursor()); cursor.insertText(text); } - - this->setCursorVisibility(Hb::TextCursorHidden); } QStringList MsgUnifiedEditorLineEdit::addresses() @@ -404,6 +423,12 @@ this->setCursorVisibility(Hb::TextCursorVisible); } +void MsgUnifiedEditorLineEdit::focusOutEvent(QFocusEvent* event) +{ + HbLineEdit::focusOutEvent(event); + this->setCursorVisibility(Hb::TextCursorHidden); +} + void MsgUnifiedEditorLineEdit::setHighlight(int currentPos) { QString txt = this->text(); @@ -528,8 +553,44 @@ return text; } +void MsgUnifiedEditorLineEdit::clearContent() +{ + // avoid getting updates during local editing + disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + + int startPos = mLabel.length(); + this->setSelection(startPos, content().length()); + QKeyEvent eve(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); + this->keyPressEvent(&eve); + this->deselect(); + + // re-connect signal to start getting updates + connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); +} + void MsgUnifiedEditorLineEdit::onContentsChanged() { emit contentsChanged(content()); } + +void MsgUnifiedEditorLineEdit::highlightInvalidString(QString invalidStr) +{ + // for only address editor + if(!mDefaultBehaviour) + { + QString txtContent = this->text(); + int searchStartPos = mLabel.length(); + int startPos = txtContent.indexOf(invalidStr, searchStartPos); + disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + // if invalidStr found + if(startPos > 0) + { + this->setSelection(startPos, invalidStr.length()); + } + connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + } +} + // eof diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/unifiededitor.pro --- a/messagingapp/msgui/unifiededitor/unifiededitor.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/unifiededitor.pro Fri May 14 15:49:35 2010 +0300 @@ -27,6 +27,8 @@ INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc INCLUDEPATH += ../../msgutils/unidatautils/unidatamodelloader/inc INCLUDEPATH += ../../msgutils/s60qconversions/inc +INCLUDEPATH += ../../msgsettings/settingsview/inc + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE CONFIG += hb @@ -53,7 +55,8 @@ msgattachmentcontainer.h \ msgbaseview.h \ msgunieditorimageprocessor.h \ - msgunieditorprocessimageoperation.h + msgunieditorprocessimageoperation.h \ + msgunifiededitorbasewidget.h SOURCES += msgmonitor.inl \ msgmonitor.cpp \ @@ -90,7 +93,8 @@ -lxqservice \ -lgsmu \ -lsmcm \ - -lxqserviceutil + -lxqserviceutil \ + -lcommonengine \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiededitor/unifiededitor.qrc --- a/messagingapp/msgui/unifiededitor/unifiededitor.qrc Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiededitor/unifiededitor.qrc Fri May 14 15:49:35 2010 +0300 @@ -1,14 +1,15 @@ - resources/animation.axml - resources/qtg_anim_longtap_1.svg - resources/qtg_anim_longtap_2.svg - resources/qtg_anim_longtap_3.svg - resources/qtg_anim_longtap_4.svg - resources/qtg_anim_longtap_5.svg - resources/qtg_anim_longtap_6.svg - resources/qtg_anim_longtap_7.svg - resources/qtg_anim_longtap_8.svg - resources/qtg_anim_longtap_9.svg + resources/qtg_anim_loading.axml + + + resources/layouts/msgunifiededitoraddress.css + resources/layouts/msgunifiededitoraddress.widgetml + resources/layouts/msgunifiededitorattachment.css + resources/layouts/msgunifiededitorattachment.widgetml + resources/layouts/msgunifiededitorbody.css + resources/layouts/msgunifiededitorbody.widgetml + resources/layouts/msgunifiededitorsubject.css + resources/layouts/msgunifiededitorsubject.widgetml diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/unicontentswidget.h --- a/messagingapp/msgui/unifiedviewer/inc/unicontentswidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/unicontentswidget.h Fri May 14 15:49:35 2010 +0300 @@ -81,7 +81,7 @@ /** * this signal is emitted when sendMessage is emitted. from UniViewerTextItem. */ - void sendMessage(const QString& phoneNumber); + void sendMessage(const QString& phoneNumber,const QString& alias = QString()); private: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h --- a/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Fri May 14 15:49:35 2010 +0300 @@ -28,14 +28,13 @@ #include "convergedmessage.h" -class QGraphicsLinearLayout; class UniViewerFeeder; class ConvergedMessage; class HbScrollArea; class UniScrollArea; class UniContentsWidget; class MessageDeleteAction; - +class HbAction; /** * Main view of unified viewer. */ @@ -102,15 +101,15 @@ * This slot is called when sendMessage signal is emitted for a highlighted * phone number, from body widget. */ - void sendMessage(const QString& phoneNumber); - -private: + void sendMessage(const QString& phoneNumber, const QString& alias = QString()); /** - * Main grid layout - * Owned + * This slot is called when delete message dialog is launched. + * @param action selected action (yes or no). */ - QGraphicsLinearLayout* mMainLayout; + void onDialogDeleteMsg(HbAction* action); + +private: /** * Feeder object diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/uniscrollarea.h --- a/messagingapp/msgui/unifiedviewer/inc/uniscrollarea.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/uniscrollarea.h Fri May 14 15:49:35 2010 +0300 @@ -49,16 +49,6 @@ */ void setPosToStart(); - /** - * Handler for UpGesture - */ - void upGesture(int value); - - /** - * Handler for DownGesture - */ - void downGesture(int value); - public slots: /** * Handle scrolling started signal diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/unitexteditor.h --- a/messagingapp/msgui/unifiedviewer/inc/unitexteditor.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Custom widget derived from HbTextEdit which provides rich text - * processing - * - */ -#ifndef UNI_TEXT_EDITOR_H -#define UNI_TEXT_EDITOR_H - -#include -#include -#include -#include -#include -#include -#include - -#include "unidatamodelplugininterface.h" - -class QGraphicsItem; - -/** - * UniTextEditor provides support for rich text processing - */ -class UniTextEditor : public HbTextEdit -{ -Q_OBJECT -public: - /** - * Constructor - */ - UniTextEditor(QGraphicsItem * parent = 0); - - /** - * Destructor - */ - ~UniTextEditor(); - -public: - - /** - * called when focus is gained. - */ - void focusInEvent(QFocusEvent *event); - - /** - * called when focus is lost. - */ - void focusOutEvent(QFocusEvent *event); - - /** - * called when mouse is pressed. - */ - void mousePressEvent(QGraphicsSceneMouseEvent *event); - - /** - * called when mouse is moved. - */ - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - - /** - * called when mouse is released. - */ - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - - }; - -#endif // UNI_TEXT_EDITOR_H -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h --- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h Fri May 14 15:49:35 2010 +0300 @@ -26,8 +26,6 @@ // FORWARD DECLARATIONS class QGraphicsLinearLayout; -class HbIconItem; -class UniViewerAddressWidget; /** * Container widget for all the address widgets @@ -72,42 +70,18 @@ */ void clearContent(); +signals: /** - * Inserts divider into layout. + * this signal is emitted when send message is triggered form UniViewerAddressWidget */ - void insertDivider(); + void sendMessage(const QString& phoneNumber,const QString& alias); private: /** - * Main layout reference. - * Own - */ - QGraphicsLinearLayout *mMainLayout; - - /** - * From widget reference. - * Own + * Main Layout */ - UniViewerAddressWidget *mFromWidget; - - /** - * To widget reference. - * Own - */ - UniViewerAddressWidget *mToWidget; - - /** - * Cc widget reference. - * Own - */ - UniViewerAddressWidget *mCcWidget; - - /** - * Divider icon item. - * Own - */ - HbIconItem *mDivider; + QGraphicsLinearLayout* mMainLayout; }; #endif // UNI_VIEWER_ADDRESS_CONTAINER_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h Fri May 14 15:49:35 2010 +0300 @@ -11,40 +11,35 @@ * * Contributors: * - * Description: + * Description: Custom widget derived from HbTextEdit which provides rich text + * processing * */ - #ifndef UNI_VIEWER_ADDRESS_WIDGET_H #define UNI_VIEWER_ADDRESS_WIDGET_H -// SYSTEM INCLUDES -#include +#include -// USER INCLUDES -#include "convergedmessageaddress.h" +#include "unidatamodelplugininterface.h" -// FORWARD DECLARATIONS -class QPointF; -class HbMenu; -class UniTextEditor; - -class UniViewerAddressWidget : public HbWidget +/** + * UniViewerAddressWidget provides support for rich text processing + */ +class UniViewerAddressWidget : public HbTextEdit { -Q_OBJECT - + Q_OBJECT + public: - /** * Constructor */ - explicit UniViewerAddressWidget(QGraphicsItem *parent = 0); + UniViewerAddressWidget(QGraphicsItem * parent = 0); /** * Destructor */ - virtual ~UniViewerAddressWidget(); - + ~UniViewerAddressWidget(); + /** * Populates the addresses and creates the anchors on them. * @param label Label of the address like - "From" @@ -57,32 +52,100 @@ * @param label Label of the address like - "To", "Cc" * @param addressList List of addresses to be populated. */ - void populate(const QString &label, - ConvergedMessageAddressList addressList); + void populate(const QString &label,ConvergedMessageAddressList addressList); /** * Clears the contents of the widget. */ void clearContent(); +protected: + + /** + * called when mouse is pressed. + */ + void mousePressEvent(QGraphicsSceneMouseEvent *event); + + /** + * called when mouse is released. + */ + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + +private: + /** + * Helper method to highlight find item on tap. + * @param highlight, if true highlight else dont. + */ + void highlightText(bool highlight); + + /** + * short tap handler. + * @param anchor anchor at cursor position. + */ + void shortTapAction(QString anchor); + + /** Helper method to get contact id against phone number or e-mail id. + * @param value phone number or email id. + * @param fieldName name of field to be matched. + * @param fieldType type of field to be matched. + */ + int resolveContactId(const QString& value, + const QString& fieldName, + const QString& fieldType); + + private slots: /** - * Handles the aboutToShowContextMenu() signal generated by HbAbstractEdit. - * @see HbAbstractEdit - * @param contextMenu Reference of the context menu. - * @param pos Position at which the context menu will be displayed. + * called when aboutToShowContextMenu signal is emitted. + */ + void aboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos); + + /** + * Called when option menu is closed. */ - void handleAboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos); + void menuClosed(); + + //handlers for phone number specific menu items. + void openContactInfo(); + void call(); + void saveToContacts(); + void sendMessage(); + void copyToClipboard(); + + //called after service request is completed. + void onServiceRequestCompleted(); + + /** + * Slot for handling valid returns from the framework. + * + * @param result const QVariant& + */ + void handleOk(const QVariant& result); + + /** + * Slot for handling errors. Error ids are provided as + * 32-bit integers. + * @param errorCode qint32 + */ + void handleError(int errorCode, const QString& errorMessage); + +signals: + /** + * this signal is emitted when send message is triggered for a highlighted number. + */ + void sendMessage(const QString& phoneNumber,const QString& alias); + private: + //Current cursor position. + int mCursorPos; + + //char formats for highlight. + QTextCharFormat mFormatHighlight; + QTextCharFormat mFormatNormal; - /** - * Reference of the editor. - * Own - */ - UniTextEditor *mAddress; -}; + }; #endif // UNI_VIEWER_ADDRESS_WIDGET_H // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Fri May 14 15:49:35 2010 +0300 @@ -23,10 +23,10 @@ #include "unidatamodelplugininterface.h" class UniViewerTextItem; -class HbIconItem; +class UniViewerPixmapWidget; class HbTextItem; class HbPushButton; -class HbGestureSceneFilter; +//class HbGestureSceneFilter; class QSignalMapper; /** @@ -57,7 +57,7 @@ * Called to insert image content in viewer. * @param medialist list of absolute paths of media. */ - void setImage(QString imagefile); + void setPixmap(QString pixmapFile); /** * Called to insert audio content in viewer. @@ -120,13 +120,12 @@ void clearContent(); protected: - // from HbWidget /** - * reimplemented from base class to provide proper geometry for scrolling. + * Reimplemented from base class to provide proper geometry for scrolling. * @see HbWidget */ - void resizeEvent(QGraphicsSceneResizeEvent* event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const; private slots: @@ -148,7 +147,7 @@ /** * called from the media object's item specific menu */ - void viewDetails(); + void saveMedia(); /** * Service launch complete. @@ -192,7 +191,7 @@ /** * Icon item to preview images. */ - HbIconItem* mIconItem; + UniViewerPixmapWidget *mPixmapItem; /** * Media widget for embedded audio content. @@ -202,7 +201,7 @@ /** * To setup longpress gesture on media objects */ - HbGestureSceneFilter* gestureFilter; + // HbGestureSceneFilter* gestureFilter; /** * File mapper for opening media diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h Fri May 14 15:49:35 2010 +0300 @@ -25,7 +25,6 @@ #include "convergedmessage.h" #include "unidatamodelplugininterface.h" -#include class QDateTime; class UniViewerFeeder; @@ -33,12 +32,6 @@ class UniDataModelPluginInterface; class UniDataModelLoader; -QTM_BEGIN_NAMESPACE -class QContactManager; -QTM_END_NAMESPACE - -QTM_USE_NAMESPACE - /** * UniViewerFeederPrivate * Feeder Private class for unified viewer. Fetches data from the @@ -180,13 +173,6 @@ * Returns the sending state of the message. */ int sendingState(); - - /** - * Gets the name(alias) for a address from the Contact database - * @int returns number of phone addresses for the specified address. - */ - static int GetNameFromContacts(const QString& address, QString& alias); - private: /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h Fri May 14 15:49:35 2010 +0300 @@ -22,8 +22,10 @@ #include +class QGraphicsLinearLayout; class UniViewerDetailsWidget; class HbGroupBox; +class HbFrameItem; class UniViewerAddressContainer; class UniViewerAttachmentContainer; class UniViewerFeeder; @@ -83,9 +85,27 @@ */ QString createAddressList(const ConvergedMessageAddressList &addressList); +private slots: + + /** + * Slot to know address box state. + */ + void addressBoxToggled(bool state); + +signals: + /** + * this signal is emitted when send message is triggered form UniViewerAddressWidget + */ + void sendMessage(const QString& phoneNumber,const QString& alias); + private: /** + * Main layout. + */ + QGraphicsLinearLayout *mMainLayout; + + /** * UniViewerFeeder object * Not Owned */ @@ -104,6 +124,12 @@ HbGroupBox *mHeaderGroupBox; /** + * Separator line + * Owned. + */ + HbFrameItem *mSeparator; + + /** * UniViewerAddressContainer object * owned. */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This widget displays the pixmap content in viewer. + * + */ + +#ifndef UNI_VIEWER_PIXMAP_WIDGET_H +#define UNI_VIEWER_PIXMAP_WIDGET_H + +#include + +/** + * This widget displays the pixmap content in viewer. + */ +class UniViewerPixmapWidget: public HbIconItem +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + UniViewerPixmapWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~UniViewerPixmapWidget(); + + /** + * Sets the pixmap content to be displayed. + * @param pixmapPath File path of the pixmap. + */ + void setPixmap(const QString &pixmapPath); + +signals: + + /** + * Signal emitted for short tap on pixmap. + * @param pixmapPath File path of the pixmap being clicked. + */ + void shortTap(const QString &pixmapPath); + +protected: + + /** + * Event handler for gesture events. + * Reimplemented from HbWidgetBase. + * @see HbWidgetBase + */ + virtual void gestureEvent(QGestureEvent *event); + +private: + + /** + * Pixmap file path being set. + */ + QString mPixmapFile; +}; + +#endif /* UNI_VIEWER_PIXMAP_WIDGET_H */ + +// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h Fri May 14 15:49:35 2010 +0300 @@ -21,11 +21,6 @@ #define UNIVIEWERTEXTITEM_H #include -#include - -//forward declarations -class QRegExp; -class XQAiwRequest; class UniViewerTextItem : public HbTextEdit { @@ -68,15 +63,6 @@ */ void highlightText(bool highlight); - /** Helper method to get contact id against phone number or e-mail id. - * @param value phone number or email id. - * @param fieldName name of field to be matched. - * @param fieldType type of field to be matched. - */ - int resolveContactId(const QString& value, - const QString& fieldName, - const QString& fieldType); - private slots: /** * called when aboutToShowContextMenu signal is emitted. @@ -142,8 +128,6 @@ //Current cursor position. int mCursorPos; - - XQApplicationManager mAppManager; }; #endif // UNIVIEWERTEXTITEM_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h Fri May 14 15:49:35 2010 +0300 @@ -79,7 +79,7 @@ /** * this signal is emitted when sendMessage is emitted. from UniViewerTextItem. */ - void sendMessage(const QString& phoneNumber); + void sendMessage(const QString& phoneNumber,const QString& alias = QString()); private: diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.css Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - -UniViewerAddressWidget -{ - layout:layout-default; -} - -UniViewerAddressWidget::addressField -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - right:var(hb-param-margin-gene-right); - bottom:var(hb-param-margin-gene-bottom); -} - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.widgetml --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.widgetml Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css Fri May 14 15:49:35 2010 +0300 @@ -2,35 +2,25 @@ UniViewerBodyWidget[hasText="true"]:portrait { layout: layout-portrait; - size-policy-vertical:minimum-expanding; - min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-chrome-height)-var(hb-param-widget-toolbar-height)+1un); } UniViewerBodyWidget[hasText="false"]:portrait { layout: layout-portrait-no-text; - size-policy-vertical:minimum-expanding; - min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-chrome-height)-var(hb-param-widget-toolbar-height)+1un); } UniViewerBodyWidget:landscape { - size-policy-vertical:minimum-expanding; - min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un); layout: layout-landscape; } UniViewerBodyWidget[hasText="true"][hasPixmap="false"]:landscape { - size-policy-vertical:minimum-expanding; - min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un); layout: layout-landscape-no-pixmap; } UniViewerBodyWidget[hasText="false"][hasPixmap="true"]:landscape { - size-policy-vertical:minimum-expanding; - min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un); layout: layout-landscape-no-text; } @@ -95,7 +85,6 @@ text-line-count-max:100; text-align: left top; font-variant:secondary; - size-policy-vertical:minimum-expanding; } UniViewerBodyWidget::textItem:portrait diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css Fri May 14 15:49:35 2010 +0300 @@ -19,7 +19,7 @@ text-height:var(hb-param-text-height-secondary); text-line-count-min:1; text-line-count-max:1; - text-align: left; + text-align:left center; } UniViewerDetailsWidget::subjectLabel @@ -31,16 +31,15 @@ text-height:var(hb-param-text-height-primary); text-line-count-min:1; text-line-count-max:10; - text-align:left; + text-align:left center; } UniViewerDetailsWidget::priorityIcon { top:-var(hb-param-margin-gene-top); right:var(hb-param-margin-gene-right); - aspect-ratio:ignore; - size-policy:fixed fixed; pref-width:var(hb-param-graphic-size-secondary); pref-height:var(hb-param-graphic-size-secondary); + size-policy:fixed fixed; } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget_color.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget_color.css Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget_color.css Fri May 14 15:49:35 2010 +0300 @@ -1,10 +1,10 @@ UniViewerDetailsWidget::timeLabel { - color:var(qtc_dataform_value); + color:var(qtc_dataform_heading); } UniViewerDetailsWidget::subjectLabel { - color:var(qtc_dataform_value); + color:var(qtc_dataform_heading); } \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.css Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.css Fri May 14 15:49:35 2010 +0300 @@ -31,13 +31,11 @@ left:-var(hb-param-margin-gene-middle-horizontal); right:var(hb-param-margin-gene-right); center-vertical:0un; - text-height:var(hb-param-text-height-tiny); + size-policy-horizontal:fixed; font-variant:secondary; - text-align:right; + text-height:var(hb-param-text-height-tiny); text-line-count-min:1; text-line-count-max:1; - size-policy-horizontal:fixed; - pref-width:13un; } UniViewerMediaWidget::bgFrame diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/unicontentswidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/unicontentswidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/unicontentswidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -38,7 +38,7 @@ { QDEBUG_WRITE("UniContentsWidget: Constructor start"); - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical,this); mMainLayout->setSpacing(0); mMainLayout->setContentsMargins(0, 0, 0, 0); @@ -58,13 +58,13 @@ // create the mInitailLoadCount number of slides for (int i = 0; i < mInitialLoadCount; i++) { - UniViewSlideWidget* slide = new UniViewSlideWidget(feeder, i); + UniViewSlideWidget* slide = new UniViewSlideWidget(feeder, i, this); addItemToLayout(slide); slide->setInsideLayout(true); mSlides.append(slide); - connect(slide,SIGNAL(sendMessage(const QString&)), - this, SIGNAL(sendMessage(const QString&))); + connect(slide,SIGNAL(sendMessage(const QString&,const QString&)), + this, SIGNAL(sendMessage(const QString&,const QString&))); } setLayout(mMainLayout); @@ -161,7 +161,7 @@ void UniContentsWidget::populateContent() { QDEBUG_WRITE("UniContentsWidget::populateContent() start"); - + if ( (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) && (mViewFeeder->slideCount() > 0) ) { @@ -228,8 +228,8 @@ slide->populateContent(); - connect(slide,SIGNAL(sendMessage(const QString&)), - this, SIGNAL(sendMessage(const QString&))); + connect(slide,SIGNAL(sendMessage(const QString&,const QString&)), + this, SIGNAL(sendMessage(const QString&,const QString&))); mTotalSlidesLoaded++; //TODO to remove the previous slide if the mTotalSlidesLoaded diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp --- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Fri May 14 15:49:35 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include // USER INCLUDES @@ -44,7 +44,7 @@ // LOCAL CONSTANTS const QString REPLY_ICON("qtg_mono_reply"); const QString REPLY_ALL_ICON("qtg_mono_reply_all"); -const QString FORWARD_ICON("qtg_mono_forward"); +const QString FORWARD_ICON("qtg_mono_forward_msg"); const QString SEND_ICON("qtg_mono_send"); const QString DELETE_ICON("qtg_mono_delete"); @@ -70,14 +70,13 @@ mMessageId = messageId; mViewFeeder = new UniViewerFeeder(mMessageId, this); - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); - mScrollArea = new UniScrollArea(this); + this->setWidget(mScrollArea); mContentsWidget = new UniContentsWidget(mViewFeeder,this); - - connect(mContentsWidget,SIGNAL(sendMessage(const QString&)), - this, SLOT(sendMessage(const QString&))); + + connect(mContentsWidget,SIGNAL(sendMessage(const QString&,const QString&)), + this, SLOT(sendMessage(const QString&,const QString&))); connect(mScrollArea, SIGNAL(scrolledToNextSlide()), mContentsWidget, SLOT(populateNextSlide())); @@ -85,11 +84,6 @@ mScrollArea->setContentWidget(mContentsWidget); mScrollArea->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); mScrollArea->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAutoHide); - mMainLayout->addItem(mScrollArea); - mMainLayout->setSpacing(0); - mMainLayout->setContentsMargins(0, 0, 0, 0); - - setLayout(mMainLayout); QDEBUG_WRITE("UnifiedViewer contruction End"); } @@ -167,6 +161,9 @@ } QDEBUG_WRITE("UnifiedViewer feeder->updateContent END"); + // Dont show the scroll bar. + mScrollArea->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); + if ( (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) && (mViewFeeder->slideCount() > 0) ) { @@ -226,7 +223,7 @@ void UnifiedViewer::resizeEvent(QGraphicsSceneResizeEvent * event) { Q_UNUSED(event) - mContentsWidget->resize(this->rect().width(), -1); + mContentsWidget->resize(this->rect().width(), this->rect().height()+1); } //--------------------------------------------------------------- @@ -235,46 +232,22 @@ //--------------------------------------------------------------- void UnifiedViewer::handleDeleteAction() { - bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, + HbMessageBox::question(LOC_DELETE_MESSAGE,this,SLOT(onDialogDeleteMsg(HbAction*)), LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL); - if (result) - { - QList msgIdList; - msgIdList << mMessageId; - - ConversationsEngine::instance()->deleteMessages(msgIdList); - - QVariantList param; - if (mMsgCount > 1) - { - param << MsgBaseView::CV; - param << MsgBaseView::UNIVIEWER; - } - else - { - param << MsgBaseView::CLV; - param << MsgBaseView::UNIVIEWER; - } - - QVariant dummy(QVariant::Invalid); - param << dummy; - emit switchView(param); - } - } //--------------------------------------------------------------- // UnifiedViewer::sendMessage // @see header file //--------------------------------------------------------------- -void UnifiedViewer::sendMessage(const QString& phoneNumber) +void UnifiedViewer::sendMessage(const QString& phoneNumber,const QString& alias) { ConvergedMessage message; message.setBodyText(QString()); ConvergedMessageAddress address; - address.setAlias(phoneNumber); + address.setAlias(alias); address.setAddress(phoneNumber); message.addToRecipient(address); @@ -312,4 +285,33 @@ return true; } +//--------------------------------------------------------------- +// UnifiedViewer::onDialogDeleteMsg +// @see header file +//--------------------------------------------------------------- +void UnifiedViewer::onDialogDeleteMsg(HbAction* action) +{ + HbMessageBox *dlg = qobject_cast (sender()); + if (action == dlg->actions().at(0)) { + QList msgIdList; + msgIdList << mMessageId; + + ConversationsEngine::instance()->deleteMessages(msgIdList); + + QVariantList param; + if (mMsgCount > 1) { + param << MsgBaseView::CV; + param << MsgBaseView::UNIVIEWER; + } + else { + param << MsgBaseView::CLV; + param << MsgBaseView::UNIVIEWER; + } + + QVariant dummy(QVariant::Invalid); + param << dummy; + emit switchView(param); + } +} + // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/uniscrollarea.cpp --- a/messagingapp/msgui/unifiedviewer/src/uniscrollarea.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/uniscrollarea.cpp Fri May 14 15:49:35 2010 +0300 @@ -143,22 +143,5 @@ widgetItem->setPos(0, 0); } -//--------------------------------------------------------------- -//UniScrollArea :: upGesture -// @see header file -//--------------------------------------------------------------- -void UniScrollArea::upGesture(int value) -{ - Q_UNUSED(value) -} - -//--------------------------------------------------------------- -//UniScrollArea :: downGesture -// @see header file -//--------------------------------------------------------------- -void UniScrollArea::downGesture(int value) -{ - Q_UNUSED(value) -} // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/unitexteditor.cpp --- a/messagingapp/msgui/unifiedviewer/src/unitexteditor.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +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:Custom widget derived from HbTextEdit which provides rich text - * processing - * - */ - -#include "unitexteditor.h" - -#include -#include -#include - -//--------------------------------------------------------------- -// UniTextEditor::UniTextEditor -// @see header file -//--------------------------------------------------------------- -UniTextEditor::UniTextEditor(QGraphicsItem * parent) : - HbTextEdit(parent) -{ - setReadOnly(true); - setCursorVisibility(Hb::TextCursorHidden); - setScrollable(false); - setAttribute(Qt::WA_InputMethodEnabled, false); -} - -//--------------------------------------------------------------- -// UniTextEditor::~UniTextEditor -// @see header file -//--------------------------------------------------------------- -UniTextEditor::~UniTextEditor() -{ - - } - -//--------------------------------------------------------------- -//UniTextEditor :: focusInEvent -// @see header file -//--------------------------------------------------------------- -void UniTextEditor::focusInEvent(QFocusEvent *event) -{ - event->ignore(); -} - -//--------------------------------------------------------------- -//UniTextEditor :: focusOutEvent -// @see header file -//--------------------------------------------------------------- -void UniTextEditor::focusOutEvent(QFocusEvent *event) -{ - event->ignore(); -} - -//--------------------------------------------------------------- -//UniTextEditor :: mousePressEvent -// @see header file -//--------------------------------------------------------------- -void UniTextEditor::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - event->ignore(); -} - -//--------------------------------------------------------------- -//UniTextEditor :: mouseMoveEvent -// @see header file -//--------------------------------------------------------------- -void UniTextEditor::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - event->ignore(); -} - -//--------------------------------------------------------------- -//UniTextEditor :: mouseReleaseEvent -// @see header file -//--------------------------------------------------------------- -void UniTextEditor::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - event->ignore(); -} - -// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp --- a/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp Fri May 14 15:49:35 2010 +0300 @@ -18,9 +18,7 @@ #include "univieweraddresscontainer.h" // SYSTEM INCLUDES -#include #include -#include // USER INCLUDES #include "univieweraddresswidget.h" @@ -29,122 +27,76 @@ #define LOC_FROM hbTrId("txt_messaging_formlabel_from") #define LOC_TO hbTrId("txt_messaging_viewer_formlabel_to") #define LOC_CC hbTrId("txt_messaging_viewer_formlabel_cc") - -// LOCAL CONSTANTS -const QString DIVIDER_ICON("qtg_graf_divider_h_thin"); +#define LOC_BCC hbTrId("txt_messaging_viewer_formlabel_bcc") //--------------------------------------------------------------- -// UniViewerAddressContainer :: UniViewerAddressContainer +// UniViewerAddressContainer::UniViewerAddressContainer // @see header file //--------------------------------------------------------------- -UniViewerAddressContainer::UniViewerAddressContainer(QGraphicsItem *parent) : - HbWidget(parent), mMainLayout(0), mFromWidget(0), mToWidget(0), mCcWidget(0), mDivider(0) +UniViewerAddressContainer::UniViewerAddressContainer(QGraphicsItem* parent) : + HbWidget(parent) { - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); mMainLayout->setContentsMargins(0, 0, 0, 0); mMainLayout->setSpacing(0); setLayout(mMainLayout); } //--------------------------------------------------------------- -// UniViewerAddressContainer :: ~UniViewerAddressContainer +// UniViewerAddressContainer::~UniViewerAddressContainer // @see header file //--------------------------------------------------------------- UniViewerAddressContainer::~UniViewerAddressContainer() { - } //--------------------------------------------------------------- -// UniViewerAddressContainer :: setFromField +// UniViewerAddressContainer::setFromField // @see header file //--------------------------------------------------------------- void UniViewerAddressContainer::setFromField(const QString& fromRecipient, const QString& alias) { - if (!mFromWidget) { - mFromWidget = new UniViewerAddressWidget(); - } + UniViewerAddressWidget* fromWidget = new UniViewerAddressWidget(this); - mMainLayout->addItem(mFromWidget); - mFromWidget->populate(LOC_FROM, fromRecipient, alias); + connect(fromWidget, SIGNAL(sendMessage(const QString&,const QString&)), this, + SIGNAL(sendMessage(const QString&,const QString&))); + + mMainLayout->addItem(fromWidget); + + fromWidget->populate(LOC_FROM, fromRecipient, alias); } //--------------------------------------------------------------- -// UniViewerAddressContainer :: setToField +// UniViewerAddressContainer::setToField // @see header file //--------------------------------------------------------------- void UniViewerAddressContainer::setToField(ConvergedMessageAddressList toRecipients) { - if (!mToWidget) { - mToWidget = new UniViewerAddressWidget(); - } + UniViewerAddressWidget* toWidget = new UniViewerAddressWidget(); + + connect(toWidget, SIGNAL(sendMessage(const QString&,const QString&)), this, + SIGNAL(sendMessage(const QString&,const QString&))); - mMainLayout->addItem(mToWidget); - mToWidget->populate(LOC_TO, toRecipients); + mMainLayout->addItem(toWidget); + + toWidget->populate(LOC_TO, toRecipients); + } //--------------------------------------------------------------- -//UniViewerAddressContainer :: setCcField +// UniViewerAddressContainer::setCcField // @see header file //--------------------------------------------------------------- void UniViewerAddressContainer::setCcField(ConvergedMessageAddressList ccRecipients) { - if (!mCcWidget) { - mCcWidget = new UniViewerAddressWidget(); - } - - mMainLayout->addItem(mCcWidget); - mCcWidget->populate(LOC_CC, ccRecipients); -} + UniViewerAddressWidget* ccWidget = new UniViewerAddressWidget(); -//--------------------------------------------------------------- -// UniViewerAddressContainer :: clearContent -// @see header file -//--------------------------------------------------------------- -void UniViewerAddressContainer::clearContent() -{ - if (mFromWidget) { - mMainLayout->removeItem(mFromWidget); - mFromWidget->setParent(NULL); - delete mFromWidget; - mFromWidget = NULL; - } - if (mToWidget) { - mMainLayout->removeItem(mToWidget); - mToWidget->setParent(NULL); - delete mToWidget; - mToWidget = NULL; - } - if (mCcWidget) { - mMainLayout->removeItem(mCcWidget); - mCcWidget->setParent(NULL); - delete mCcWidget; - mCcWidget = NULL; - } - if (mDivider) { - mMainLayout->removeItem(mDivider); - mDivider->setParent(NULL); - delete mDivider; - mDivider = NULL; - } + connect(ccWidget, SIGNAL(sendMessage(const QString&,const QString&)), this, + SIGNAL(sendMessage(const QString&,const QString&))); - resize(rect().width(), -1); -} + mMainLayout->addItem(ccWidget); -//--------------------------------------------------------------- -// UniViewerAddressContainer :: insertDivider -// @see header file -//--------------------------------------------------------------- -void UniViewerAddressContainer::insertDivider() -{ - if (!mDivider) { - mDivider = new HbIconItem(this); - } - - mDivider->sizePolicy().setHorizontalPolicy(QSizePolicy::Expanding); - mDivider->sizePolicy().setVerticalPolicy(QSizePolicy::Fixed); - mDivider->setIconName(DIVIDER_ICON); - mMainLayout->addItem(mDivider); + ccWidget->populate(LOC_CC, ccRecipients); } // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -11,51 +11,119 @@ * * Contributors: * - * Description: + * Description:Custom widget derived from HbTextEdit which provides rich text + * processing * */ #include "univieweraddresswidget.h" -#include "univiewerfeeder_p.h" + // SYSTEM INCLUDES -#include -#include #include #include +#include +#include +#include +#include +#include +#include +#include -// USER INCLUDES -#include "unitexteditor.h" +#include +#include +#include +#include +#include +#include "msgcontacthandler.h" + + + + // LOCAL CONSTANTS const QString ADDRESS_SEPARATOR("; "); const QString ADDRESS_OPEN(" ("); const QString ADDRESS_CLOSE(")"); +const QString SPACE(" "); -//---------------------------------------------------------------------------- +//localization +#define LOC_OPEN_CONTACT_INFO hbTrId("txt_messaging_menu_open_contact_info") +#define LOC_CALL hbTrId("txt_common_menu_call_verb") +#define LOC_SEND_MESSAGE hbTrId("txt_common_menu_send_message") +#define LOC_SAVE_TO_CONTACTS hbTrId("txt_common_menu_save_to_contacts") +#define LOC_COPY hbTrId("txt_common_menu_copy") + +const QString BG_FRAME_GRAPHICS("qtg_fr_lineedit_normal"); + +//--------------------------------------------------------------- // UniViewerAddressWidget::UniViewerAddressWidget // @see header file -//---------------------------------------------------------------------------- -UniViewerAddressWidget::UniViewerAddressWidget(QGraphicsItem *parent) : - HbWidget(parent), mAddress(NULL) +//--------------------------------------------------------------- +UniViewerAddressWidget::UniViewerAddressWidget(QGraphicsItem * parent) : +HbTextEdit(parent), +mCursorPos(-1) { - mAddress = new UniTextEditor(this); - HbStyle::setItemName(mAddress, "addressField"); + this->setReadOnly(true); + this->setCursorVisibility(Hb::TextCursorHidden); + this->setScrollable(false); + HbFrameItem *noBackground = new HbFrameItem(this); + this->setBackgroundItem(noBackground); - connect(mAddress, SIGNAL(aboutToShowContextMenu(HbMenu *,QPointF)), this, - SLOT(handleAboutToShowContextMenu(HbMenu *,QPointF))); + HbFontSpec fontSpec(HbFontSpec::Secondary); + QFont font = fontSpec.font(); + this->setFont(font); - // TODO: Wrapping fix breaking normal scenarios. - // this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + mFormatNormal.setForeground(palette().link()); + mFormatNormal.setBackground(Qt::transparent); + + mFormatHighlight.setBackground(palette().highlight()); + mFormatHighlight.setForeground(palette().highlightedText()); + + connect(this, SIGNAL(aboutToShowContextMenu(HbMenu*,QPointF)), + this, SLOT(aboutToShowContextMenu(HbMenu*,QPointF))); } -//---------------------------------------------------------------------------- +//--------------------------------------------------------------- // UniViewerAddressWidget::~UniViewerAddressWidget // @see header file -//---------------------------------------------------------------------------- +//--------------------------------------------------------------- UniViewerAddressWidget::~UniViewerAddressWidget() { } +//--------------------------------------------------------------- +//UniViewerAddressWidget :: mousePressEvent +// @see header file +//--------------------------------------------------------------- +void UniViewerAddressWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + HbTextEdit::mousePressEvent(event); + + QTextDocument* doc = this->document(); + + mCursorPos = doc->documentLayout()->hitTest(event->pos(), Qt::ExactHit); + + highlightText(true); +} + +//--------------------------------------------------------------- +//UniViewerAddressWidget :: mouseReleaseEvent +// @see header file +//--------------------------------------------------------------- +void UniViewerAddressWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + HbTextEdit::mouseReleaseEvent(event); + + highlightText(false); + + QString anchor = this->anchorAt(event->pos()); + + if(!anchor.isEmpty() && !this->textCursor().hasSelection()) + { + shortTapAction(anchor); + } +} + //---------------------------------------------------------------------------- // UniViewerAddressWidget::populate // @see header file @@ -64,22 +132,40 @@ const QString &address, const QString &alias) { - - QTextCursor cursor(mAddress->document()); - - QTextCharFormat addressFormat = cursor.charFormat(); - addressFormat.setFontWeight(QFont::Bold); - addressFormat.setForeground(QApplication::palette().link()); - addressFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); + QString labelText = label; + labelText.trimmed(); + labelText += SPACE; + + //Font. + HbFontSpec fontSpec(HbFontSpec::Secondary); + qreal fontHeight = 0.0; + style()->parameter("hb-param-text-height-tiny", fontHeight); + fontSpec.setTextHeight(fontHeight); + QFont font = fontSpec.font(); + + QTextCharFormat labelFormat; + labelFormat.setFont(font); + + QTextCharFormat addressFormat; + addressFormat.setForeground(palette().link()); + addressFormat.setFontUnderline(true); // Insert the label then the addresses - cursor.insertText(label); + QTextCursor cursor(this->textCursor()); + cursor.insertText(labelText,labelFormat); + QString address1 = QString(); if (!(alias.isEmpty())) { address1.append(alias); QString alias1 = QString(); - if (UniViewerFeederPrivate::GetNameFromContacts(address, alias1) > 1) + + int totalNumbers = 0; + MsgContactHandler::resolveContactDisplayName( + address, + alias1, + totalNumbers); + if (totalNumbers > 1) { address1.append(ADDRESS_OPEN); address1.append(address); @@ -92,7 +178,6 @@ } addressFormat.setAnchorHref(address); cursor.insertText(address1, addressFormat); - repolish(); } //---------------------------------------------------------------------------- @@ -102,19 +187,30 @@ void UniViewerAddressWidget::populate(const QString &label, ConvergedMessageAddressList addressList) { - QTextCursor cursor(mAddress->document()); + QString labelText = label; + labelText.trimmed(); + labelText += SPACE; + + //Font. + HbFontSpec fontSpec(HbFontSpec::Secondary); + qreal fontHeight = 0.0; + style()->parameter("hb-param-text-height-tiny", fontHeight); + fontSpec.setTextHeight(fontHeight); + QFont font = fontSpec.font(); + + QTextCharFormat labelFormat; + labelFormat.setFont(font); + + QTextCharFormat defaultFormat; + defaultFormat.setForeground(palette().link()); - QTextCharFormat defaultFormat = cursor.charFormat(); - defaultFormat.setFontWeight(QFont::Bold); - defaultFormat.setForeground(QApplication::palette().link()); - - QTextCharFormat addressFormat = cursor.charFormat(); - addressFormat.setFontWeight(QFont::Bold); - addressFormat.setForeground(QApplication::palette().link()); - addressFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); + QTextCharFormat addressFormat; + addressFormat.setForeground(palette().link()); + addressFormat.setFontUnderline(true); // Insert the label then the addresses - cursor.insertText(label); + QTextCursor cursor(this->document()); + cursor.insertText(labelText,labelFormat); int addressCount = addressList.count(); @@ -126,8 +222,13 @@ { address.append(addressList[i]->alias()); QString alias = QString(); - if (UniViewerFeederPrivate::GetNameFromContacts(addressList[i]->address(), - alias) > 1) + + int totalNumbers = 0; + MsgContactHandler::resolveContactDisplayName( + addressList[i]->address(), + alias, + totalNumbers); + if (totalNumbers > 1) { address.append(ADDRESS_OPEN); address.append(addressList[i]->address()); @@ -148,7 +249,6 @@ } } - repolish(); } //---------------------------------------------------------------------------- @@ -157,17 +257,254 @@ //---------------------------------------------------------------------------- void UniViewerAddressWidget::clearContent() { - mAddress->document()->clear(); + this->document()->clear(); +} + +//---------------------------------------------------------------------------- +// UniViewerAddressWidget::menuClosed +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAddressWidget::menuClosed() +{ + highlightText(false); } //---------------------------------------------------------------------------- -// UniViewerAddressWidget::handleAboutToShowContextMenu +// UniViewerAddressWidget::highlightText // @see header file //---------------------------------------------------------------------------- -void UniViewerAddressWidget::handleAboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos) +void UniViewerAddressWidget::highlightText(bool highlight) +{ + QTextBlock textBlock = this->document()->findBlock(mCursorPos); + + QTextBlock::iterator it; + + for (it = textBlock.begin(); !(it.atEnd()); ++it) + { + QTextFragment currentFragment = it.fragment(); + + if (currentFragment.isValid() && currentFragment.contains(mCursorPos) + && currentFragment.charFormat().fontUnderline()) + { + int start = currentFragment.position(); + int length = currentFragment.length(); + + QTextCursor cursor = this->textCursor(); + cursor.clearSelection(); + cursor.setPosition(start); + cursor.setPosition(start + length,QTextCursor::KeepAnchor); + + if(highlight) + { + cursor.mergeCharFormat(mFormatHighlight); + } + else + { + cursor.mergeCharFormat(mFormatNormal); + } + + cursor.clearSelection(); + break; + } + } +} + +void UniViewerAddressWidget::aboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos) +{ + //remove default actions. + contextMenu->clearActions(); + + // Check if there is an anchor at this pos + QString anchor = this->anchorAt(pos); + + if(!anchor.isEmpty() && !this->textCursor().hasSelection()) + { + + HbAction* action = NULL; + + action = contextMenu->addAction(LOC_OPEN_CONTACT_INFO, this, SLOT(openContactInfo())); + action->setData(anchor); + + action = contextMenu->addAction(LOC_CALL, this, SLOT(call())); + action->setData(anchor); + + action = contextMenu->addAction(LOC_SEND_MESSAGE, this, SLOT(sendMessage())); + action->setData(anchor); + + action = contextMenu->addAction(LOC_SAVE_TO_CONTACTS, this, SLOT(saveToContacts())); + action->setData(anchor); + + action = contextMenu->addAction(LOC_COPY, this, SLOT(copyToClipboard())); + action->setData(anchor); + + } + + connect(contextMenu,SIGNAL(aboutToClose()),this,SLOT(menuClosed())); +} + +void UniViewerAddressWidget::shortTapAction(QString anchor) +{ + HbAction action; + action.setData(anchor); + connect(&action,SIGNAL(triggered()),this,SLOT(openContactInfo())); + action.trigger(); +} + +void UniViewerAddressWidget::copyToClipboard() +{ + HbAction* action = qobject_cast(sender()); + + if(action) + { + QMimeData* data = new QMimeData(); + QString str = action->data().toString(); + data->setText(str); + QApplication::clipboard()->setMimeData(data); + } +} + +void UniViewerAddressWidget::call() { - Q_UNUSED(pos) - contextMenu->clearActions(); + HbAction* action = qobject_cast(sender()); + + if(action) + { + QString phoneNumber = action->data().toString(); + + //invoke dialer service and pass phoneNumber. + QString serviceName("com.nokia.services.telephony"); + QString operation("dial(QString)"); + + XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false); + + connect(serviceRequest, SIGNAL(requestCompleted(QVariant)), + this, SLOT(onServiceRequestCompleted())); + + connect(serviceRequest, SIGNAL(requestError(int)), + this, SLOT(onServiceRequestCompleted())); + + *serviceRequest << phoneNumber; + serviceRequest->send(); + } +} + +void UniViewerAddressWidget::onServiceRequestCompleted() + { + //service request is now complete. delete it. + XQServiceRequest* request = qobject_cast(sender()); + + if(request) + { + delete request; + } + } + + +void UniViewerAddressWidget::openContactInfo() +{ + HbAction* action = qobject_cast(sender()); + + if(action) + { + QList args; + QString operation; + + QString data = action->data().toString(); + + int contactId = MsgContactHandler::resolveContactDisplayName( + data, + QContactPhoneNumber::DefinitionName, + QContactPhoneNumber::FieldNumber); + + if(contactId > 0) + { + //open contact card + operation = QString("open(int)"); + args << contactId; + } + else + { + //save to contacts with phone number field prefilled. + + operation = QString("editCreateNew(QString,QString)"); + QString type = QContactPhoneNumber::DefinitionName; + + args << type; + args << data; + } + + //service stuff. + QString serviceName("com.nokia.services.phonebookservices"); + + XQAiwRequest* request; + XQApplicationManager appManager; + request = appManager.create(serviceName, "Fetch", operation, true); // embedded + if ( request == NULL ) + { + return; + } + + // Result handlers + connect (request, SIGNAL(requestOk(const QVariant&)), + this, SLOT(handleOk(const QVariant&))); + connect (request, SIGNAL(requestError(const QVariant&)), + this, SLOT(handleError(const QVariant&))); + + request->setArguments(args); + request->send(); + delete request; + } +} + +void UniViewerAddressWidget::handleOk(const QVariant& result) + { + Q_UNUSED(result) + } + +void UniViewerAddressWidget::handleError(int errorCode, const QString& errorMessage) + { + Q_UNUSED(errorMessage) + Q_UNUSED(errorCode) + } + +void UniViewerAddressWidget::saveToContacts() +{ + //handler for save to contacts. +} + +void UniViewerAddressWidget::sendMessage() +{ + HbAction* action = qobject_cast(sender()); + + if(action) + { + QString phoneNumber = action->data().toString(); + QString alias; + + QTextBlock textBlock = this->document()->findBlock(mCursorPos); + + QTextBlock::iterator it; + + for (it = textBlock.begin(); !(it.atEnd()); ++it) + { + QTextFragment currentFragment = it.fragment(); + + if (currentFragment.isValid() && currentFragment.contains(mCursorPos) + && currentFragment.charFormat().fontUnderline()) + { + QString txt = currentFragment.text(); + if(txt != phoneNumber) + { + alias = txt; + } + break; + } + } + + + //invoke editor & pass phoneNumber. + emit sendMessage(phoneNumber,alias); + } } // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -20,30 +20,27 @@ #include #include #include -#include #include #include -#include #include -#include #include #include -#include -#include -#include #include #include #include #include "univiewertextitem.h" +#include "univiewerpixmapwidget.h" #include "msgmediautil.h" // LOCAL CONSTANTS const QString AUDIO_ICON("qtg_mono_audio"); // Localization #define LOC_TITLE hbTrId("txt_messaging_title_messaging") +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_SAVE hbTrId("txt_common_menu_save") //--------------------------------------------------------------- //UniViewerBodyWidget::UniViewerBodyWidget @@ -51,14 +48,9 @@ //--------------------------------------------------------------- UniViewerBodyWidget::UniViewerBodyWidget(QGraphicsItem *parent) : HbWidget(parent), mHasText(false), mHasPixmap(false), mTextItem(0), mSlideCounter(0), - mIconItem(0), mAudioItem(0) + mPixmapItem(0), mAudioItem(0) { - //Gesture filter for the image - gestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); - gestureFilter->setLongpressAnimation(true); - HbGesture *gesture = new HbGesture(HbGesture::longpress, 20); - gestureFilter->addGesture(gesture); - connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF))); + this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); // Signal mapper for opening media files mSignalMapper = new QSignalMapper(this); connect(mSignalMapper, SIGNAL(mapped(const QString &)), this, SLOT(openMedia(const QString &))); @@ -76,21 +68,18 @@ //UniViewerBodyWidget::setImage // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::setImage(QString imagefile) +void UniViewerBodyWidget::setPixmap(QString pixmapFile) { setHasPixmap(true); //create image item instance - if (!mIconItem) { - mIconItem = new HbIconItem(this); - HbStyle::setItemName(mIconItem, "pixmap"); + if (!mPixmapItem) { + mPixmapItem = new UniViewerPixmapWidget(this); + HbStyle::setItemName(mPixmapItem, "pixmap"); + connect(mPixmapItem, SIGNAL(shortTap(QString)), this, SLOT(openMedia(QString))); } - QPixmap pixmap(imagefile); - mIconItem->setIcon(HbIcon(pixmap)); - - // TODO - // Implementation for short tap action is unclear - // Connect to signal mapper + mPixmapItem->hide(); + mPixmapItem->setPixmap(pixmapFile); this->repolish(); } @@ -105,6 +94,7 @@ mAudioItem = new HbPushButton(this); HbStyle::setItemName(mAudioItem, "audioItem"); } + mAudioItem->hide(); QFileInfo fileInfo(audiofile); mAudioItem->setIcon(HbIcon(AUDIO_ICON)); mAudioItem->setText(fileInfo.baseName()); @@ -142,6 +132,7 @@ connect(mTextItem, SIGNAL(sendMessage(const QString&)), this, SIGNAL(sendMessage(const QString&))); } + mTextItem->hide(); text.replace(QChar::ParagraphSeparator, QChar::LineSeparator); text.replace('\r', QChar::LineSeparator); mTextItem->setText(text); @@ -159,6 +150,7 @@ HbStyle::setItemName(mSlideCounter, "slideCounter"); } + mSlideCounter->hide(); mSlideCounter->setText(slideCounter); this->repolish(); } @@ -216,12 +208,10 @@ if (type.contains("text")) { QFile file(info->path()); - if (file.open(QIODevice::ReadOnly)) - { - QString textContent(file.readAll()); - setTextContent(textContent); - } - + if (file.open(QIODevice::ReadOnly)) { + QString textContent(file.readAll()); + setTextContent(textContent); + } } else if (type.contains("video")) { setVideo(info->path()); @@ -230,7 +220,7 @@ setAudio(info->path()); } else if (type.contains("image")) { - setImage(info->path()); + setPixmap(info->path()); } delete info; @@ -244,10 +234,10 @@ void UniViewerBodyWidget::clearContent() { // delete the temp items(pixmap) & clear permanent items(text) - if (mIconItem) { - mIconItem->setParent(NULL); - delete mIconItem; - mIconItem = NULL; + if (mPixmapItem) { + mPixmapItem->setParent(NULL); + delete mPixmapItem; + mPixmapItem = NULL; } if (mAudioItem) { @@ -268,93 +258,149 @@ } //--------------------------------------------------------------- -//UniViewerBodyWidget::resizeEvent +//UniViewerBodyWidget::sizeHint // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::resizeEvent(QGraphicsSceneResizeEvent* event) +QSizeF UniViewerBodyWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { - Q_UNUSED(event) + QSizeF szHint = HbWidget::sizeHint(which, constraint); HbMainWindow *mainWindow = this->mainWindow(); - if (mainWindow) { - qreal screenWidth = 0.0; - qreal screenHeight = 0.0; - qreal leftMargin = 0.0; - qreal rightMargin = 0.0; - qreal chromeHeight = 0.0; - qreal toolbarHeight = 0.0; - qreal iconSize = 0.0; - qreal unitSize = HbDeviceProfile::profile(mIconItem).unitValue(); - style()->parameter("hb-param-screen-width", screenWidth); - style()->parameter("hb-param-screen-height", screenHeight); - style()->parameter("hb-param-margin-gene-left", leftMargin); - style()->parameter("hb-param-margin-gene-right", rightMargin); - style()->parameter("hb-param-widget-chrome-height", chromeHeight); - style()->parameter("hb-param-widget-toolbar-height", toolbarHeight); - style()->parameter("hb-param-graphic-size-primary-large", iconSize); + if (!mainWindow) { + return szHint; + } + + qreal screenWidth = 0.0; + qreal screenHeight = 0.0; + qreal leftMargin = 0.0; + qreal rightMargin = 0.0; + qreal chromeHeight = 0.0; + qreal toolbarHeight = 0.0; + qreal iconSize = 0.0; + qreal spacing = 0.0; + qreal unitSize = HbDeviceProfile::profile(mPixmapItem).unitValue(); + style()->parameter("hb-param-screen-width", screenWidth); + style()->parameter("hb-param-screen-height", screenHeight); + style()->parameter("hb-param-margin-gene-left", leftMargin); + style()->parameter("hb-param-margin-gene-right", rightMargin); + style()->parameter("hb-param-widget-chrome-height", chromeHeight); + style()->parameter("hb-param-widget-toolbar-height", toolbarHeight); + style()->parameter("hb-param-graphic-size-primary-large", iconSize); + style()->parameter("hb-param-margin-gene-middle-vertical", spacing); - qreal maxWidth = 0.0; - qreal maxHeight = 0.0; + qreal maxWidth = 0.0; + qreal maxHeight = 0.0; + + // Calculate max height & max width. + if (mainWindow->orientation() == Qt::Horizontal) { + qreal temp; + temp = screenWidth; + screenWidth = screenHeight; + screenHeight = temp; + + if (mPixmapItem && mHasText) { + maxWidth = (screenWidth / 2) - leftMargin - unitSize; + } + else { + maxWidth = screenWidth - leftMargin - rightMargin; + } + maxHeight = screenHeight - chromeHeight - toolbarHeight; + + if (mAudioItem) { + mAudioItem->setStretched(true); + } + } + else if (mainWindow->orientation() == Qt::Vertical) { + maxWidth = screenWidth - leftMargin - rightMargin; + maxHeight = screenHeight - chromeHeight - toolbarHeight; - if (mainWindow->orientation() == Qt::Horizontal) { - qreal temp; - temp = screenWidth; - screenWidth = screenHeight; - screenHeight = temp; - if (mIconItem) { - if (mHasText) { - maxWidth = (screenWidth / 2) - leftMargin - unitSize; - } - else { - maxWidth = screenWidth - leftMargin - rightMargin; - } - maxHeight = screenHeight - chromeHeight - toolbarHeight; - } - if (mAudioItem) { - mAudioItem->setStretched(true); - } + if (mAudioItem) { + mAudioItem->setStretched(false); } - else if (mainWindow->orientation() == Qt::Vertical) { - if (mIconItem) { - maxWidth = screenWidth - leftMargin - rightMargin; - maxHeight = screenHeight - chromeHeight - toolbarHeight; - } - if (mAudioItem) { - mAudioItem->setStretched(false); - } + } + + // Slide Counter + QSizeF slideCounterSize(0, 0); + if (mSlideCounter) { + slideCounterSize = mSlideCounter->effectiveSizeHint(which, constraint); + mSlideCounter->show(); + } + // Audio Item + QSizeF audioSize(0, 0); + if (mAudioItem) { + audioSize = mAudioItem->effectiveSizeHint(which, constraint); + mAudioItem->show(); + } + + // Text Item + QSizeF textSize(0, 0); + if (mTextItem) { + textSize = mTextItem->effectiveSizeHint(which, constraint); + mTextItem->show(); + } + + // Pixmap Item + QSizeF pixmapSize(0, 0); + if (mPixmapItem) { + qreal imageWidth = mPixmapItem->icon().defaultSize().width(); + qreal imageHeight = mPixmapItem->icon().defaultSize().height(); + + qreal widthToSet = 0.0; + qreal heightToSet = 0.0; + + if (imageWidth < iconSize) { + widthToSet = iconSize; + heightToSet = iconSize; + } + else if (imageWidth <= maxWidth) { + // resize not needed + widthToSet = imageWidth; + heightToSet = qMin(imageHeight, maxHeight); + } + else { + // resize needed, keep aspect-ratio and resize + widthToSet = maxWidth; + heightToSet = maxWidth * (imageHeight / imageWidth); + heightToSet = qMin(heightToSet, maxHeight); + + } + if (heightToSet == maxHeight) { + widthToSet = heightToSet * (imageWidth / imageHeight); } - if (mIconItem) { - qreal imageWidth = mIconItem->icon().defaultSize().width(); - qreal imageHeight = mIconItem->icon().defaultSize().height(); + pixmapSize.setHeight(heightToSet); + pixmapSize.setWidth(widthToSet); + mPixmapItem->setPreferredSize(pixmapSize); + mPixmapItem->show(); + } - qreal widthToSet = 0.0; - qreal heightToSet = 0.0; + // Calculate the size hint to be returned. + szHint.setHeight(0); - if (imageWidth < iconSize) { - widthToSet = iconSize; - heightToSet = iconSize; - } - else if (imageWidth <= maxWidth) { - // resize not needed - widthToSet = imageWidth; - heightToSet = qMin(imageHeight, maxHeight); - } - else { - // resize needed, keep aspect-ratio and resize - widthToSet = maxWidth; - heightToSet = maxWidth * (imageHeight / imageWidth); - heightToSet = qMin(heightToSet, maxHeight); + if (!slideCounterSize.isNull()) { + szHint.rheight() += (slideCounterSize.height() + spacing); + } + if (!audioSize.isNull()) { + szHint.rheight() += (audioSize.height() + spacing); + } - } - if (heightToSet == maxHeight) { - widthToSet = heightToSet * (imageWidth / imageHeight); - } - - mIconItem->setPreferredWidth(widthToSet); - mIconItem->setPreferredHeight(heightToSet); + if (mainWindow->orientation() == Qt::Horizontal) { + qreal remainingHeight = qMax(pixmapSize.height(), textSize.height()); + if (remainingHeight > 0.0) { + szHint.rheight() += (remainingHeight + spacing); } } + else if (mainWindow->orientation() == Qt::Vertical) { + if (!pixmapSize.isNull()) { + szHint.rheight() += (pixmapSize.height() + spacing); + } + if (!textSize.isNull()) { + szHint.rheight() += (textSize.height() + spacing); + } + } + szHint.rheight() = qMax(maxHeight, szHint.height()); + + return szHint; } //--------------------------------------------------------------- @@ -365,10 +411,11 @@ { HbMenu* menu = new HbMenu; - menu->addAction(tr("Open"), this, SLOT(openMedia())); - menu->addAction(tr("View details"), this, SLOT(viewDetails())); - menu->exec(position); - delete menu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->addAction(LOC_OPEN, this, SLOT(openMedia())); + menu->addAction(LOC_SAVE, this, SLOT(saveMedia())); + menu->setPreferredPos(position); + menu->show(); } //--------------------------------------------------------------- @@ -437,12 +484,11 @@ } //--------------------------------------------------------------- -//UniViewerBodyWidget::viewDetails +//UniViewerBodyWidget::saveMedia // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::viewDetails() +void UniViewerBodyWidget::saveMedia() { - //open details view. } //--------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -44,7 +44,6 @@ HbWidget(parent), mSubjectLabel(0), mPriorityIcon(0) { // Permanent items & will not be removed - mTime = new HbTextItem(this); HbStyle::setItemName(mTime, "timeLabel"); } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -20,14 +20,12 @@ #include #include #include -#include -#include "qtcontacts.h" -#include "qcontactdetailfilter.h" // USER INCLUDES #include "nativemessageconsts.h" #include "univiewerfeeder.h" #include "unidatamodelloader.h" +#include "msgcontacthandler.h" #include "debugtraces.h" // --------------------------------------------------------------------------- @@ -269,7 +267,10 @@ QString alias = QString(); for (int i = 0; i < mToAddressList.count(); ++i) { - GetNameFromContacts(mToAddressList.at(i)->address(), alias); + MsgContactHandler::resolveContactDisplayName( + mToAddressList.at(i)->address(), + alias, + 0); mToAddressList.at(i)->setAlias(alias); alias.clear(); } @@ -285,7 +286,10 @@ QString alias = QString(); for (int i = 0; i < mCcAddressList.count(); ++i) { - GetNameFromContacts(mCcAddressList.at(i)->address(), alias); + MsgContactHandler::resolveContactDisplayName( + mToAddressList.at(i)->address(), + alias, + 0); mCcAddressList.at(i)->setAlias(alias); alias.clear(); @@ -309,7 +313,10 @@ void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias) { mPluginInterface->fromAddress(from); - GetNameFromContacts(from, alias); + MsgContactHandler::resolveContactDisplayName( + from, + alias, + 0); } // --------------------------------------------------------------------------- @@ -332,47 +339,4 @@ mCcAddressList.clear(); } -// --------------------------------------------------------------------------- -// UniViewerFeederPrivate::GetNameFromContacts -// @see header file -//---------------------------------------------------------------------------- -int UniViewerFeederPrivate::GetNameFromContacts(const QString& address, - QString& alias) -{ - QContactManager contactManager("symbian"); - //set filter - QContactDetailFilter phoneFilter; - phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); - phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); - - phoneFilter.setValue(address); // this is the phone number to be resolved - - QList sortOrder; - QList matchingContacts = - contactManager.contacts(phoneFilter, - sortOrder, - QStringList()); - - int count = 0; - if (matchingContacts.count() > 0) - { - QContact match = matchingContacts.at(0); - - QString displayLabel = match.displayLabel(); - - if (displayLabel != "Unnamed") - { - alias.append(displayLabel); - } - - QList numbers = - match.details (); - count = numbers.count(); - - } - - return count; -} - // EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp Fri May 14 15:49:35 2010 +0300 @@ -36,42 +36,50 @@ // LOCAL CONSTANTS const QString ADDR_LIST_SEPARATOR(", "); const QString BG_FRAME_GRAPHICS("qtg_fr_form_heading"); +const QString DIVIDER_FRAME("qtg_graf_divider_h_thin"); //--------------------------------------------------------------- // UniViewerHeaderContainer :: UniViewerHeaderContainer // @see header file //--------------------------------------------------------------- UniViewerHeaderContainer::UniViewerHeaderContainer(UniViewerFeeder* feeder, QGraphicsItem *parent) : - HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0), + HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0), mSeparator(0), mAddressContainer(0), mAttachmentContainer(0) { + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + HbFrameItem *bgItem = new HbFrameItem(BG_FRAME_GRAPHICS, HbFrameDrawer::NinePieces, this); this->setBackgroundItem(bgItem); - QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical); - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0, 0, 0, 0); + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); + mMainLayout->setSpacing(0); + mMainLayout->setContentsMargins(0, 0, 0, 0); // Address Group box mHeaderGroupBox = new HbGroupBox(this); + connect(mHeaderGroupBox, SIGNAL(toggled(bool)), this, SLOT(addressBoxToggled(bool))); // Address container - mAddressContainer = new UniViewerAddressContainer(mHeaderGroupBox); + mAddressContainer = new UniViewerAddressContainer(this); + connect(mAddressContainer,SIGNAL(sendMessage(const QString&,const QString&)), + this, SIGNAL(sendMessage(const QString&,const QString&))); mHeaderGroupBox->setContentWidget(mAddressContainer); + // Separator + mSeparator = new HbFrameItem(DIVIDER_FRAME, HbFrameDrawer::OnePiece, this); + mSeparator->setMaximumHeight(1); + mSeparator->hide(); + // Viewer Details widget mViewerDetails = new UniViewerDetailsWidget(this); - // Attachment Container - mAttachmentContainer = new UniViewerAttachmentContainer(this); + //Add address group box and insert into layout + mMainLayout->addItem(mHeaderGroupBox); + mMainLayout->addItem(mSeparator); + mMainLayout->addItem(mViewerDetails); - //Add address group box and insert into layout - mainLayout->addItem(mHeaderGroupBox); - mainLayout->addItem(mViewerDetails); - mainLayout->addItem(mAttachmentContainer); - - this->setLayout(mainLayout); + this->setLayout(mMainLayout); } //--------------------------------------------------------------- @@ -124,9 +132,6 @@ if (mViewerDetails) { mViewerDetails->clearContent(); } - if (mAddressContainer) { - mAddressContainer->clearContent(); - } if (mAttachmentContainer) { mAttachmentContainer->clearContent(); } @@ -162,6 +167,12 @@ //--------------------------------------------------------------- void UniViewerHeaderContainer::populateAttachments() { + if (!mAttachmentContainer) { + // Attachment Container + mAttachmentContainer = new UniViewerAttachmentContainer(this); + mMainLayout->addItem(mAttachmentContainer); + } + UniMessageInfoList attachList = mViewFeeder->attachmentsList(); for (int a = 0; a < attachList.count(); ++a) { UniMessageInfo* info = attachList.at(a); @@ -184,20 +195,22 @@ if (mViewFeeder->isIncoming()) { mAddressContainer->setFromField(from, alias); } - // TO field is added ONLY for outgoing messages. - else if (!toList.isEmpty()) { + // For outgoing SMS messages add TO field. + else if (mViewFeeder->msgType() == KSenduiMtmSmsUidValue && !toList.isEmpty()) { mAddressContainer->setToField(toList); } - // CC field is added ONLY for MMS messages. + // For MMS messages add TO, CC, BCC fields irrespective of incoming/outgoing. if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) { + if (!toList.isEmpty()) { + mAddressContainer->setToField(toList); + } ConvergedMessageAddressList ccList = mViewFeeder->ccAddressList(); if (!ccList.isEmpty()) { mAddressContainer->setCcField(ccList); } } - mAddressContainer->insertDivider(); } //--------------------------------------------------------------- // UniViewerHeaderContainer :: setAddrGroupBoxHeading @@ -237,3 +250,12 @@ address.chop(ADDR_LIST_SEPARATOR.size()); return address; } + +//--------------------------------------------------------------- +// UniViewerHeaderContainer :: addressBoxToggled +// @see header file +//--------------------------------------------------------------- +void UniViewerHeaderContainer::addressBoxToggled(bool state) +{ + (state) ? mSeparator->hide() : mSeparator->show(); +} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This widget displays the pixmap content in viewer. + * + */ + +#include "univiewerpixmapwidget.h" + +#include +#include +#include +#include + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::UniViewerPixmapWidget +// @see header file +//--------------------------------------------------------------- +UniViewerPixmapWidget::UniViewerPixmapWidget(QGraphicsItem *parent) : + HbIconItem(parent) +{ + mPixmapFile = QString(""); + this->grabGesture(Qt::TapGesture); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::~UniViewerPixmapWidget +// @see header file +//--------------------------------------------------------------- +UniViewerPixmapWidget::~UniViewerPixmapWidget() +{ +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::setPixmap +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::setPixmap(const QString &pixmapPath) +{ + mPixmapFile = pixmapPath; + QPixmap pixmap(pixmapPath); + this->setIcon(HbIcon(pixmap)); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::gestureEvent +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::gestureEvent(QGestureEvent *event) +{ + HbTapGesture *tapGesture = qobject_cast (event->gesture(Qt::TapGesture)); + if (tapGesture) { + switch (tapGesture->state()) { + case Qt::GestureStarted: + { + // Trigger haptic feedback. + HbInstantFeedback::play(HbFeedback::Basic); + break; + } + case Qt::GestureUpdated: + { + if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { + // emit longtap + } + break; + } + case Qt::GestureFinished: + { + if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { + // Emit short tap + emit shortTap(mPixmapFile); + } + break; + } + case Qt::GestureCanceled: + { + break; + } + } + } +} + +// EOF diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Fri May 14 15:49:35 2010 +0300 @@ -18,6 +18,7 @@ */ #include "univiewertextitem.h" +#include "msgcontacthandler.h" #include #include @@ -27,12 +28,12 @@ #include #include +#include #include -#include #include #include +#include -QTM_USE_NAMESPACE //consts @@ -65,7 +66,11 @@ mCursorPos(-1) { this->setReadOnly(true); + this->setScrollable(false); this->setCursorVisibility(Hb::TextCursorHidden); + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + HbFrameItem *noBackground = new HbFrameItem(this); + this->setBackgroundItem(noBackground); //inserting rules and patterns to map. mRules.insert(NUMBER_RULE,NUMBER_PATTERN); @@ -346,7 +351,8 @@ QString serviceName("com.nokia.services.commonemail"); QString interfaceName("imessage.send"); QString operation("send(QVariant)"); - XQAiwRequest* request = mAppManager.create(serviceName, interfaceName, + XQApplicationManager appManager; + XQAiwRequest* request = appManager.create(serviceName, interfaceName, operation, true); if ( request == NULL ) { @@ -414,9 +420,10 @@ { data.remove(NUMBER_RULE); - int contactId = resolveContactId(data, - QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); + int contactId = MsgContactHandler::resolveContactDisplayName( + data, + QContactPhoneNumber::DefinitionName, + QContactPhoneNumber::FieldNumber); if(contactId > 0) { @@ -439,9 +446,10 @@ { data.remove(EMAIL_RULE); - int contactId = resolveContactId(data, - QContactEmailAddress::DefinitionName, - QContactEmailAddress::FieldEmailAddress); + int contactId = MsgContactHandler::resolveContactDisplayName( + data, + QContactEmailAddress::DefinitionName, + QContactEmailAddress::FieldEmailAddress); if(contactId > 0) { @@ -466,7 +474,8 @@ QString serviceName("com.nokia.services.phonebookservices"); XQAiwRequest* request; - request = mAppManager.create(serviceName, "Fetch", operation, true); // embedded + XQApplicationManager appManager; + request = appManager.create(serviceName, "Fetch", operation, true); // embedded if ( request == NULL ) { return; @@ -502,33 +511,6 @@ } } -int UniViewerTextItem::resolveContactId(const QString& value, - const QString& fieldName, - const QString& fieldType) - { - int contactId = -1; - - QContactManager phonebookManager("symbian"); - - QContactDetailFilter phoneFilter; - phoneFilter.setDetailDefinitionName(fieldName, fieldType); - phoneFilter.setValue(value); - phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); - - QList sortOrder; - QList matchingContacts = phonebookManager.contacts( - phoneFilter, - sortOrder, - QStringList()); - - if ( matchingContacts.count() > 0 ) - { - contactId = matchingContacts.at(0).localId();; - } - - return contactId; - } - void UniViewerTextItem::menuClosed() { highlightText(false); @@ -565,6 +547,7 @@ } cursor.clearSelection(); + break; } } } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp Fri May 14 15:49:35 2010 +0300 @@ -38,7 +38,7 @@ mHeaderContainer(0) { - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); mMainLayout->setSpacing(0); mMainLayout->setContentsMargins(0, 0, 0, 0); @@ -54,6 +54,11 @@ // Always connect to populate sms content connect(mViewFeeder, SIGNAL(msgBody(QString)), mBody, SLOT(setTextContent(QString))); + + connect(mHeaderContainer,SIGNAL(sendMessage(const QString&,const QString&)), + this, SIGNAL(sendMessage(const QString&,const QString&))); + + mMainLayout->addItem(mHeaderContainer); } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/unifiedviewer.pro --- a/messagingapp/msgui/unifiedviewer/unifiedviewer.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.pro Fri May 14 15:49:35 2010 +0300 @@ -39,7 +39,7 @@ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 CONFIG += hb -QT += sql +HB += hbfeedback # Platforms SYMBIAN_PLATFORMS = WINSCW ARMV5 @@ -52,7 +52,6 @@ # Input HEADERS += inc/unifiedviewer.h \ inc/unicontentswidget.h \ - inc/unitexteditor.h \ # inc/unihighlighter.h \ inc/univiewerfeeder.h \ inc/univiewerfeeder_p.h \ @@ -66,11 +65,11 @@ inc/univiewermediawidget.h \ inc/univiewerattachmentcontainer.h \ inc/univiewertextitem.h \ - inc/univiewerheadercontainer.h + inc/univiewerheadercontainer.h \ + inc/univiewerpixmapwidget.h SOURCES += src/unifiedviewer.cpp \ src/unicontentswidget.cpp \ - src/unitexteditor.cpp \ # src/unihighlighter.cpp \ src/univiewerfeeder.cpp \ src/univiewerfeeder_p.cpp \ @@ -83,8 +82,8 @@ src/univiewermediawidget.cpp \ src/univiewerattachmentcontainer.cpp \ src/univiewertextitem.cpp \ - src/univiewerheadercontainer.cpp - + src/univiewerheadercontainer.cpp \ + src/univiewerpixmapwidget.cpp RESOURCES += unifiedviewer.qrc diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgui/unifiedviewer/unifiedviewer.qrc --- a/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc Fri May 14 15:49:35 2010 +0300 @@ -1,7 +1,5 @@ - resources/layouts/univieweraddresswidget.css - resources/layouts/univieweraddresswidget.widgetml resources/layouts/univiewerbodywidget.css resources/layouts/univiewerbodywidget_color.css resources/layouts/univiewerbodywidget.widgetml diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.inl --- a/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.inl Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.inl Fri May 14 15:49:35 2010 +0300 @@ -17,7 +17,6 @@ * */ -#include "debugtraces.h" // --------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.inl --- a/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.inl Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.inl Fri May 14 15:49:35 2010 +0300 @@ -17,7 +17,6 @@ * */ -#include "debugtraces.h" // --------------------------------------------------------- // CUniSmilModel::Layout diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp --- a/messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp Fri May 14 15:49:35 2010 +0300 @@ -21,7 +21,6 @@ // ========== INCLUDE FILES ================================ -#include "debugtraces.h" #include #include diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def --- a/messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def Fri May 14 15:49:35 2010 +0300 @@ -2,28 +2,29 @@ ?absoluteMaxSmsCharactersL@UniEditorGenUtils@@AAEHXZ @ 1 NONAME ; int UniEditorGenUtils::absoluteMaxSmsCharactersL(void) ??0UniEditorGenUtils@@QAE@XZ @ 2 NONAME ; UniEditorGenUtils::UniEditorGenUtils(void) ??0CMuiuOperationWait@@IAE@H@Z @ 3 NONAME ; CMuiuOperationWait::CMuiuOperationWait(int) - ?MaxSmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 4 NONAME ; int UniEditorGenUtils::MaxSmsRecipientsL(void) - ?Start@CMuiuOperationWait@@QAEXXZ @ 5 NONAME ; void CMuiuOperationWait::Start(void) - ?getSmsCharacterLimits@UniEditorGenUtils@@AAEXAAH0_N@Z @ 6 NONAME ; void UniEditorGenUtils::getSmsCharacterLimits(int &, int &, bool) - ?MaxSmsMsgSizeL@UniEditorGenUtils@@QAEH_N@Z @ 7 NONAME ; int UniEditorGenUtils::MaxSmsMsgSizeL(bool) - ?DoCancel@CMuiuOperationWait@@MAEXXZ @ 8 NONAME ; void CMuiuOperationWait::DoCancel(void) - ?MaxMmsMsgSizeL@UniEditorGenUtils@@QAEHXZ @ 9 NONAME ; int UniEditorGenUtils::MaxMmsMsgSizeL(void) - ??_ECMuiuOperationWait@@UAE@I@Z @ 10 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(unsigned int) - ?ReplaceCharacters@UniEditorGenUtils@@QAEXAAVTDes16@@ABVTDesC16@@VTChar@@@Z @ 11 NONAME ; void UniEditorGenUtils::ReplaceCharacters(class TDes16 &, class TDesC16 const &, class TChar) - ?NumberToBase@UniEditorGenUtils@@QAE?AVTChar@@V2@@Z @ 12 NONAME ; class TChar UniEditorGenUtils::NumberToBase(class TChar) - ?ConvertDigitsTo@UniEditorGenUtils@@QAEXAAVTDes16@@W4TDigitType@@@Z @ 13 NONAME ; void UniEditorGenUtils::ConvertDigitsTo(class TDes16 &, enum TDigitType) - ?NewLC@CMuiuOperationWait@@SAPAV1@H@Z @ 14 NONAME ; class CMuiuOperationWait * CMuiuOperationWait::NewLC(int) - ?RunL@CMuiuOperationWait@@MAEXXZ @ 15 NONAME ; void CMuiuOperationWait::RunL(void) - ?getFileInfoL@UniEditorGenUtils@@QAEXVQString@@AAHAAV2@AAW4TMsgMediaType@@@Z @ 16 NONAME ; void UniEditorGenUtils::getFileInfoL(class QString, int &, class QString &, enum TMsgMediaType &) - ?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 17 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void) - ??1CMuiuOperationWait@@UAE@XZ @ 18 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void) - ?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 19 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList) - ?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 20 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &) - ?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 21 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &) - ?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 22 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void) - ?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 23 NONAME ; int UniEditorGenUtils::UTF8Size(class QString) - ?IsValidEmailAddress@UniEditorGenUtils@@QAEHVQString@@@Z @ 24 NONAME ; int UniEditorGenUtils::IsValidEmailAddress(class QString) - ?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 25 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void) - ??1UniEditorGenUtils@@QAE@XZ @ 26 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void) - ?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 27 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void) + ?IsValidDomain@UniEditorGenUtils@@AAEHABVTDesC16@@@Z @ 4 NONAME ; int UniEditorGenUtils::IsValidDomain(class TDesC16 const &) + ?MaxSmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 5 NONAME ; int UniEditorGenUtils::MaxSmsRecipientsL(void) + ?Start@CMuiuOperationWait@@QAEXXZ @ 6 NONAME ; void CMuiuOperationWait::Start(void) + ?getSmsCharacterLimits@UniEditorGenUtils@@AAEXAAH0_N@Z @ 7 NONAME ; void UniEditorGenUtils::getSmsCharacterLimits(int &, int &, bool) + ?MaxSmsMsgSizeL@UniEditorGenUtils@@QAEH_N@Z @ 8 NONAME ; int UniEditorGenUtils::MaxSmsMsgSizeL(bool) + ?DoCancel@CMuiuOperationWait@@MAEXXZ @ 9 NONAME ; void CMuiuOperationWait::DoCancel(void) + ?MaxMmsMsgSizeL@UniEditorGenUtils@@QAEHXZ @ 10 NONAME ; int UniEditorGenUtils::MaxMmsMsgSizeL(void) + ??_ECMuiuOperationWait@@UAE@I@Z @ 11 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(unsigned int) + ?ReplaceCharacters@UniEditorGenUtils@@QAEXAAVTDes16@@ABVTDesC16@@VTChar@@@Z @ 12 NONAME ; void UniEditorGenUtils::ReplaceCharacters(class TDes16 &, class TDesC16 const &, class TChar) + ?NumberToBase@UniEditorGenUtils@@QAE?AVTChar@@V2@@Z @ 13 NONAME ; class TChar UniEditorGenUtils::NumberToBase(class TChar) + ?IsValidEmailAddress@UniEditorGenUtils@@QAEHABVTDesC16@@@Z @ 14 NONAME ; int UniEditorGenUtils::IsValidEmailAddress(class TDesC16 const &) + ?ConvertDigitsTo@UniEditorGenUtils@@QAEXAAVTDes16@@W4TDigitType@@@Z @ 15 NONAME ; void UniEditorGenUtils::ConvertDigitsTo(class TDes16 &, enum TDigitType) + ?NewLC@CMuiuOperationWait@@SAPAV1@H@Z @ 16 NONAME ; class CMuiuOperationWait * CMuiuOperationWait::NewLC(int) + ?RunL@CMuiuOperationWait@@MAEXXZ @ 17 NONAME ; void CMuiuOperationWait::RunL(void) + ?getFileInfoL@UniEditorGenUtils@@QAEXVQString@@AAHAAV2@AAW4TMsgMediaType@@@Z @ 18 NONAME ; void UniEditorGenUtils::getFileInfoL(class QString, int &, class QString &, enum TMsgMediaType &) + ?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 19 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void) + ??1CMuiuOperationWait@@UAE@XZ @ 20 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void) + ?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 21 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList) + ?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 22 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &) + ?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 23 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &) + ?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 24 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void) + ?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 25 NONAME ; int UniEditorGenUtils::UTF8Size(class QString) + ?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 26 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void) + ??1UniEditorGenUtils@@QAE@XZ @ 27 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void) + ?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 28 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def --- a/messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def Fri May 14 15:49:35 2010 +0300 @@ -1,35 +1,36 @@ EXPORTS _ZN17UniEditorGenUtils12NumberToBaseE5TChar @ 1 NONAME _ZN17UniEditorGenUtils12getFileInfoLE7QStringRiRS0_R13TMsgMediaType @ 2 NONAME - _ZN17UniEditorGenUtils14MaxMmsMsgSizeLEv @ 3 NONAME - _ZN17UniEditorGenUtils14MaxSmsMsgSizeLEb @ 4 NONAME - _ZN17UniEditorGenUtils15ConvertDigitsToER6TDes1610TDigitType @ 5 NONAME - _ZN17UniEditorGenUtils15IsPhoneOfflineLEv @ 6 NONAME - _ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 7 NONAME - _ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 8 NONAME - _ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 9 NONAME - _ZN17UniEditorGenUtils19IsValidEmailAddressE7QString @ 10 NONAME - _ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 11 NONAME - _ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 12 NONAME - _ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 13 NONAME - _ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_b @ 14 NONAME - _ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 15 NONAME - _ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 16 NONAME - _ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 17 NONAME - _ZN17UniEditorGenUtils8UTF8SizeE7QString @ 18 NONAME - _ZN17UniEditorGenUtilsC1Ev @ 19 NONAME - _ZN17UniEditorGenUtilsC2Ev @ 20 NONAME - _ZN17UniEditorGenUtilsD1Ev @ 21 NONAME - _ZN17UniEditorGenUtilsD2Ev @ 22 NONAME - _ZN18CMuiuOperationWait4RunLEv @ 23 NONAME - _ZN18CMuiuOperationWait5NewLCEi @ 24 NONAME - _ZN18CMuiuOperationWait5StartEv @ 25 NONAME - _ZN18CMuiuOperationWait8DoCancelEv @ 26 NONAME - _ZN18CMuiuOperationWaitC1Ei @ 27 NONAME - _ZN18CMuiuOperationWaitC2Ei @ 28 NONAME - _ZN18CMuiuOperationWaitD0Ev @ 29 NONAME - _ZN18CMuiuOperationWaitD1Ev @ 30 NONAME - _ZN18CMuiuOperationWaitD2Ev @ 31 NONAME - _ZTI18CMuiuOperationWait @ 32 NONAME - _ZTV18CMuiuOperationWait @ 33 NONAME + _ZN17UniEditorGenUtils13IsValidDomainERK7TDesC16 @ 3 NONAME + _ZN17UniEditorGenUtils14MaxMmsMsgSizeLEv @ 4 NONAME + _ZN17UniEditorGenUtils14MaxSmsMsgSizeLEb @ 5 NONAME + _ZN17UniEditorGenUtils15ConvertDigitsToER6TDes1610TDigitType @ 6 NONAME + _ZN17UniEditorGenUtils15IsPhoneOfflineLEv @ 7 NONAME + _ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 8 NONAME + _ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 9 NONAME + _ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 10 NONAME + _ZN17UniEditorGenUtils19IsValidEmailAddressERK7TDesC16 @ 11 NONAME + _ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 12 NONAME + _ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 13 NONAME + _ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 14 NONAME + _ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_b @ 15 NONAME + _ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 16 NONAME + _ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 17 NONAME + _ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 18 NONAME + _ZN17UniEditorGenUtils8UTF8SizeE7QString @ 19 NONAME + _ZN17UniEditorGenUtilsC1Ev @ 20 NONAME + _ZN17UniEditorGenUtilsC2Ev @ 21 NONAME + _ZN17UniEditorGenUtilsD1Ev @ 22 NONAME + _ZN17UniEditorGenUtilsD2Ev @ 23 NONAME + _ZN18CMuiuOperationWait4RunLEv @ 24 NONAME + _ZN18CMuiuOperationWait5NewLCEi @ 25 NONAME + _ZN18CMuiuOperationWait5StartEv @ 26 NONAME + _ZN18CMuiuOperationWait8DoCancelEv @ 27 NONAME + _ZN18CMuiuOperationWaitC1Ei @ 28 NONAME + _ZN18CMuiuOperationWaitC2Ei @ 29 NONAME + _ZN18CMuiuOperationWaitD0Ev @ 30 NONAME + _ZN18CMuiuOperationWaitD1Ev @ 31 NONAME + _ZN18CMuiuOperationWaitD2Ev @ 32 NONAME + _ZTI18CMuiuOperationWait @ 33 NONAME + _ZTV18CMuiuOperationWait @ 34 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h --- a/messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h Fri May 14 15:49:35 2010 +0300 @@ -121,13 +121,6 @@ TInt MaxMmsRecipientsL(); /** - * Checks if a given address string is a valid email address - * @param addr address string - * @return ETrue if addr is valid email address - */ - TBool IsValidEmailAddress( QString addr ); - - /** * Calculates the size of the given message * @param msg ConvergedMessage * @return size of the converged message @@ -187,6 +180,13 @@ */ void ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement); + /** + * Checks if a given address string is a valid email address + * @param addr address string + * @return ETrue if addr is valid email address + */ + TBool IsValidEmailAddress( const TDesC& aAddress ); + private: /** * get sms character limits from feature manager @@ -213,6 +213,11 @@ */ int absoluteMaxSmsCharactersL(); + /** + * validate the domain portion of an email address + */ + TBool IsValidDomain ( const TDesC& aDomain ); + private: //data /** * Read only once for optimization purpose diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp --- a/messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp Fri May 14 15:49:35 2010 +0300 @@ -28,6 +28,16 @@ #include "UniEditorGenUtils.h" #include "s60qconversions.h" +// CONSTANTS +const TInt KMuiuCharQuote = '\"'; +const TInt KMuiuCharBackSlash = '\\'; +const TInt KMuiuCharDot = '.'; +const TInt KMuiuCharSpace = ' '; +const TInt KMuiuCharDel = 127; +const TInt KMuiuCharAt = '@'; +const TInt KMuiuSpecialCharStrLen = 12; +_LIT( KRFC822Specials,"()<>@,;:\\\"[]"); + // ============================ MEMBER FUNCTIONS =============================== // ---------------------------------------------------- @@ -163,20 +173,29 @@ // UniEditorGenUtils::VerifyEmailAddressesL // @see header // ---------------------------------------------------- -TBool UniEditorGenUtils::VerifyEmailAddressesL( ConvergedMessageAddressList addr) +TBool UniEditorGenUtils::VerifyEmailAddressesL( ConvergedMessageAddressList addrList) { - TBool emailAddrPresent = EFalse; - - for ( int i=0; i< addr.count(); i++) - { - if( IsValidEmailAddress(addr[i]->address()) ) - { - emailAddrPresent = ETrue; - break; - } - } - - return emailAddrPresent; + TBool emailAddrPresent = EFalse; + int addrCount = addrList.count(); + for(int i=0; i< addrCount; i++) + { + QString addr = addrList.at(i)->address(); + // check if email address, contains at least 3 characters + if(addr.size() >= 3) + { + // search for @ from the address + // however, it can't be the first or the last item + for(int i = 1; i < addr.size() - 1; i++) + { + if(addr.at(i) == '@') + { + emailAddrPresent = ETrue; + break; + } + } + } + } + return emailAddrPresent; } // ---------------------------------------------------- @@ -252,27 +271,6 @@ } // ---------------------------------------------------- -// UniEditorGenUtils::IsValidEmailAddress -// @see header -// ---------------------------------------------------- -TBool UniEditorGenUtils::IsValidEmailAddress( QString addr ) - { - // valid email address contains at least 3 characters - if( addr.size() >= 3 ) - { - // search for @ from the address. however, it can't be the first or the last item - for ( int i = 1; i < addr.size() - 1; i++ ) - { - if ( addr.at(i) == '@' ) - { - return ETrue; - } - } - } - return EFalse; - } - -// ---------------------------------------------------- // UniEditorGenUtils::MaxMmsMsgSizeL // @see header // ---------------------------------------------------- @@ -482,4 +480,126 @@ } } +// ---------------------------------------------------- +// UniEditorGenUtils::IsValidEmailAddressL +// @see header +// ---------------------------------------------------- +TBool UniEditorGenUtils::IsValidEmailAddress( const TDesC& aAddress ) + { + TInt c; + TInt length = aAddress.Length (); + TBufC rfc822Specials ( KRFC822Specials ); + + // first we validate the name portion (name@domain) + if ( length && aAddress[0] == KMuiuCharDot ) + { + return EFalse; + } + for ( c = 0 ; c < length ; c++ ) + { + if ( aAddress[c] == KMuiuCharQuote && ( c == 0 || + aAddress[c-1] == KMuiuCharDot || aAddress[c-1] == KMuiuCharQuote ) ) + { + while ( ++c < length ) + { + if ( aAddress[c] == KMuiuCharQuote ) + { + if( (c + 1) == length) + { + return EFalse; + } + break; + } + if ( aAddress[c] == KMuiuCharBackSlash && + ( aAddress[++c] == KMuiuCharSpace) ) + { + continue; + } + if ( aAddress[c] <= KMuiuCharSpace || + aAddress[c] >= KMuiuCharDel ) + { + return EFalse; + } + } + if ( c++ == length ) + { + return EFalse; + } + if ( aAddress[c] == KMuiuCharAt ) + { + break; + } + if ( aAddress[c] != KMuiuCharDot ) + { + return EFalse; + } + continue; + } + if ( aAddress[c] == KMuiuCharAt ) + { + break; + } + if ( aAddress[c] <= KMuiuCharSpace || aAddress[c] >= KMuiuCharDel ) + { + return EFalse; + } + if ( rfc822Specials.Locate ( aAddress[c] ) != KErrNotFound ) + { + return EFalse; + } + } + if ( c == 0 || aAddress[c-1] == KMuiuCharDot ) + { + return EFalse; + } + // next we validate the domain portion (name@domain) + if ( c == length ) + { + return EFalse; + } + else + { + c++; + return IsValidDomain ( aAddress.Mid ( ( c ) , length-c ) ); + } + } + +// ---------------------------------------------------- +// UniEditorGenUtils::IsValidDomainL +// @see header +// ---------------------------------------------------- +TBool UniEditorGenUtils::IsValidDomain ( const TDesC& aDomain ) + { + TInt c = 0; + TInt length = aDomain.Length (); + TBufC rfc822Specials ( KRFC822Specials ); + + if ( length == 0 ) + { + return EFalse; + } + + do + { + if ( aDomain[c] == KMuiuCharDot ) + { + if ( c == 0 || aDomain[c-1] == KMuiuCharDot ) + { + return EFalse; + } + } + if ( aDomain[c] <= KMuiuCharSpace || aDomain[c] >= KMuiuCharDel ) + { + return EFalse; + } + if ( rfc822Specials.Locate( aDomain[c] ) != KErrNotFound ) + { + return EFalse; + } + } + while ( ++c < length ); + + return ( aDomain[length-1] != '.' ); + } + // End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -89,10 +89,18 @@ delete iUniDataModel; ifsSession.Close(); - delete iMmsMtm; + if(iMmsMtm) + { + delete iMmsMtm; + } + delete iMtmRegistry; delete iDataModelPluginLoader; - delete iSession; + + if(iSession) + { + delete iSession; + } } // ----------------------------------------------------------------------------- @@ -102,7 +110,7 @@ // CUniEditorMmsPluginPrivate::CUniEditorMmsPluginPrivate( ) { - iSession = CMsvSession::OpenSyncL(*this); + TRAP_IGNORE(iSession = CMsvSession::OpenSyncL(*this)); } // ----------------------------------------------------------------------------- @@ -570,7 +578,7 @@ // CMmsClientMtm* CUniEditorMmsPluginPrivate::MmsMtmL() { - if ( !iMmsMtm ) + if ( !iMmsMtm && iSession ) { if ( !iMtmRegistry ) { @@ -782,10 +790,13 @@ // void CUniEditorMmsPluginPrivate::deleteDraftsEntryL( TMsvId aId ) { - CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue); - CleanupStack::PushL(pEntry); - pEntry->DeleteL( aId ); - CleanupStack::PopAndDestroy(pEntry); + if(iSession) + { + CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue); + CleanupStack::PushL(pEntry); + pEntry->DeleteL( aId ); + CleanupStack::PopAndDestroy(pEntry); + } } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h Fri May 14 15:49:35 2010 +0300 @@ -110,7 +110,7 @@ inline void SetUnicodeMode( TBool aUnicodeMode ); //Turkish SMS(PREQ2265) specific... - void SetEncodingSettings(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType); + void SetEncodingSettingsL(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType); /** * for deciding on reduced or full charset support diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp Fri May 14 15:49:35 2010 +0300 @@ -140,8 +140,10 @@ void UniEditorSmsPlugin::setEncodingSettings(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType) { - d_ptr->SetEncodingSettings(aUnicodeMode, aAlternativeEncodingType, - charSupportType); + TRAPD(error, d_ptr->SetEncodingSettingsL(aUnicodeMode, + aAlternativeEncodingType, + charSupportType)); + QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::setEncodingSettings error = ",error); } //--------------------------------------------------------------- diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -438,10 +438,10 @@ { HBufC* addr = S60QConversions::qStringToS60Desc( addrList.at(i)->address() ); HBufC* alt_alias = S60QConversions::qStringToS60Desc( addrList.at(i)->alias() ); - if(addr) + if(addr->Length() > 0) { CleanupStack::PushL(addr); - if(alt_alias) + if(alt_alias->Length() > 0) CleanupStack::PushL(alt_alias); HBufC* pureAddr = TMmsGenUtils::PureAddress( *addr ).AllocLC(); HBufC* aliasAddr = TMmsGenUtils::Alias( *addr ).AllocLC(); @@ -461,7 +461,7 @@ } else { - if(alt_alias) + if(alt_alias->Length() > 0) { SmsMtmL()->AddAddresseeL( *pureAddr, *alt_alias ); appendbuf.Set(alt_alias->Des().Left(appendLen)); @@ -482,7 +482,7 @@ // cleanup CleanupStack::PopAndDestroy(2, pureAddr ); - if(alt_alias) + if(alt_alias->Length() > 0) { CleanupStack::PopAndDestroy( alt_alias ); } @@ -740,7 +740,7 @@ //Initialize the settings - SetEncodingSettings( iUnicodeMode, ESmsEncodingNone, + SetEncodingSettingsL( iUnicodeMode, ESmsEncodingNone, iCharSupportType); //get bodytext @@ -1623,7 +1623,7 @@ // encoding or char support // when corresponding feilds change. Hence aUnicodeMode is always set to false //------------------------------------------------------------------------------ -void UniEditorSmsPluginPrivate::SetEncodingSettings( TBool aUnicodeMode, +void UniEditorSmsPluginPrivate::SetEncodingSettingsL( TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt aCharSupportType) { @@ -1708,7 +1708,7 @@ { //switch to Unicode //iUnicodeMode = ETrue; - SetEncodingSettings( ETrue, iAlternativeEncodingType, TUniSendingSettings::EUniCharSupportFull); + SetEncodingSettingsL( ETrue, iAlternativeEncodingType, TUniSendingSettings::EUniCharSupportFull); } else { diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/inc/shareuiprivate.h --- a/messagingapp/shareui/inc/shareuiprivate.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/inc/shareuiprivate.h Fri May 14 15:49:35 2010 +0300 @@ -36,7 +36,7 @@ class HbTextItem; class HbIconItem; -#define SERVICE_INTERFACE "imessage.send" +#define SERVICE_INTERFACE "com.nokia.symbian.IFileShare" #define SHARE_OP "send(QVariant)" /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/rom/shareui.iby --- a/messagingapp/shareui/rom/shareui.iby Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/rom/shareui.iby Fri May 14 15:49:35 2010 +0300 @@ -19,5 +19,6 @@ REM DLL file=ABI_DIR\UREL\shareui.dll SHARED_LIB_DIR\shareui.dll +data=DATAZ_\system\install\shareui_stub.sis system\install\shareui_stub.sis #endif // __SHAREUI_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/shareui.pro --- a/messagingapp/shareui/shareui.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/shareui.pro Fri May 14 15:49:35 2010 +0300 @@ -39,6 +39,7 @@ # Build.inf rules BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ + "sis/shareui_stub.sis /epoc32/data/z/system/install/shareui_stub.sis" \ "rom/shareui.iby CORE_APP_LAYER_IBY_EXPORT_PATH(shareui.iby)" diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/sis/shareui.pkg --- a/messagingapp/shareui/sis/shareui.pkg Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/sis/shareui.pkg Fri May 14 15:49:35 2010 +0300 @@ -17,7 +17,7 @@ &EN ; SIS header: name, uid, version -#{"shareui"},(0xEEB59ABB),1,0,0, TYPE = SA,RU +#{"shareui"},(0x2002DD00),1,0,0, TYPE = SA,RU ; Localised Vendor name %{"Nokia"} @@ -27,4 +27,4 @@ ; Executable and default resource files "/epoc32/release/armv5/urel/shareui.dll" - "!:\sys\bin\shareui.dll",FR,RI -"/epoc32/data/z/pluginstub/unifiededitorplugin.qtplugin" - "!:\private\2002bce7\unifiededitorplugin.qtplugin" + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/sis/shareui_stub.pkg --- a/messagingapp/shareui/sis/shareui_stub.pkg Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/sis/shareui_stub.pkg Fri May 14 15:49:35 2010 +0300 @@ -17,7 +17,7 @@ &EN ; Header -#{"shareui"}, (0xEEB59ABB), 1, 0, 0, TYPE = SA +#{"shareui"}, (0x2002DD00), 1, 0, 0, TYPE = SA ; Localised Vendor name %{"Nokia"} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/sis/shareui_stub.sis Binary file messagingapp/shareui/sis/shareui_stub.sis has changed diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/src/shareuiprivate.cpp --- a/messagingapp/shareui/src/shareuiprivate.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/src/shareuiprivate.cpp Fri May 14 15:49:35 2010 +0300 @@ -78,22 +78,10 @@ void ShareUiPrivate::reset() { mFileList.clear(); - - mIndexActionMap.clear(); // TODO Is there MEM leak. - mAiwRequestList.clear(); // TODO Is there MEM leak. - - if ( mContentItemModel ) - { - delete mContentItemModel; - mContentItemModel = 0; - } - - if ( mContentListView ) - { - delete mContentListView; - mContentListView = 0; - } - + + mIndexActionMap.clear(); + mAiwRequestList.clear(); + if ( mSharePopup ) { delete mSharePopup; @@ -201,7 +189,7 @@ return true; } - mSharePopup->exec(); + mSharePopup->show(); } else { @@ -218,13 +206,13 @@ { // Dialog mSharePopup = new HbDialog(); - + // make it delete itself on close + mSharePopup->setAttribute( Qt::WA_DeleteOnClose, true ); HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup); heading->setAlignment(Qt::AlignCenter); + mSharePopup->setDismissPolicy(HbDialog::NoDismiss); mSharePopup->setHeadingWidget(heading); - mSharePopup->setTimeout(HbDialog::NoTimeout); mSharePopup->setFrameType(HbDialog::Strong); - mSharePopup->setPrimaryAction(new HbAction(LOC_BUTTON_CANCEL, mSharePopup)); // Content widget mContentListView = new HbListView(mSharePopup); @@ -237,6 +225,9 @@ mSharePopup->setContentWidget(mContentListView); connect(mContentListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex))); + + HbAction* cancelAction = new HbAction(LOC_BUTTON_CANCEL,mSharePopup); + mSharePopup->addAction(cancelAction); } /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/inc/testshareuimainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/shareui/tsrc/testshareui/inc/testshareuimainwindow.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Offers message creation and sending services. + * +*/ + +#ifndef TESTSHAREUIMAINWINDOW_H +#define TESTSHAREUIMAINWINDOW_H + +#include + +class TestShareUiView; + + +class TestShareUiMainWindow : public HbMainWindow +{ + Q_OBJECT + +public: + TestShareUiMainWindow(QWidget *parent = 0); + ~TestShareUiMainWindow(); + bool init(); +private: + TestShareUiView* mView; + +}; + +#endif // SENDUITESTMAINWINDOW_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/inc/testshareuiview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/shareui/tsrc/testshareui/inc/testshareuiview.h Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,45 @@ +/* +* 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: Offers message creation and sending services. + * +*/ + +#ifndef TESTSHAREUIVIEW_H_ +#define TESTSHAREUIVIEW_H_ + +#include +#include +#include + +class ShareUi; + +class TestShareUiView : public HbView + { + Q_OBJECT + +public: + TestShareUiView(HbMainWindow* parent = 0); + virtual ~TestShareUiView(); + bool init(); + +public slots: + + void openCvPop(); + +private: + HbToolBar* mToolBar; + ShareUi* mDialog; + }; + +#endif /* DEVICEVIEW_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/main.cpp --- a/messagingapp/shareui/tsrc/testshareui/main.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +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: Offers message creation and sending services. - * -*/ - -#include -#include -#include "testshareuimainwindow.h" - -int main(int argc, char *argv[]) -{ - HbApplication a(argc, argv); - TestShareUiMainWindow mainWin; - mainWin.init(); - mainWin.show(); - return a.exec(); -} diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/rom/testshareui.iby --- a/messagingapp/shareui/tsrc/testshareui/rom/testshareui.iby Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/tsrc/testshareui/rom/testshareui.iby Fri May 14 15:49:35 2010 +0300 @@ -14,13 +14,13 @@ * Description: * */ -#ifndef __SENDUI101_IBY__ -#define __SENDUI101_IBY__ +#ifndef __TESTSHAREUI_IBY__ +#define __TESTSHAREUI_IBY__ REM DLL file=ABI_DIR\UREL\testshareui.exe SHARED_LIB_DIR\testshareui.exe data=DATAZ_\resource\apps\testshareui.rsc resource\apps\testshareui.rsc data=DATAZ_\private\10003a3f\import\apps\testshareui_reg.rsc private\10003a3f\import\apps\testshareui_reg.rsc -data=DATAZ_\resource\apps\0xE5605609.mif resource\apps\0xE5605609.mif +data=DATAZ_\resource\apps\0x2002DD18.mif resource\apps\0x2002DD18.mif -#endif // __SENDUI101_IBY__ +#endif // __TESTSHAREUI_IBY__ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/sis/testshareui.pkg --- a/messagingapp/shareui/tsrc/testshareui/sis/testshareui.pkg Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/tsrc/testshareui/sis/testshareui.pkg Fri May 14 15:49:35 2010 +0300 @@ -21,7 +21,7 @@ &EN ; SIS header: name, uid, version -#{"shareui"},(0xE5605609),1,0,0, TYPE = SA,RU +#{"testshareui"},(0x2002DD18),1,0,0, TYPE = SA,RU ; Localised Vendor name %{"Nokia"} @@ -33,4 +33,4 @@ "/epoc32/release/armv5/urel/testshareui.exe" - "!:\sys\bin\testshareui.exe",FR,RI "/epoc32/data/z/resource/apps/testshareui.rsc" - "!:\resource\apps\testshareui.rsc" "/epoc32/data/z/private/10003a3f/import/apps/testshareui_reg.rsc" - "!:\private\10003a3f\import\apps\testshareui_reg.rsc" -;"/epoc32/data/z/resource/apps/0xE5605609.mif" - "!:\resource\apps\0xE5605609.mif" +;"/epoc32/data/z/resource/apps/0x2002DD18.mif" - "!:\resource\apps\0x2002DD18.mif" diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/sis/testshareui.sisx Binary file messagingapp/shareui/tsrc/testshareui/sis/testshareui.sisx has changed diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/shareui/tsrc/testshareui/src/main.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Offers message creation and sending services. + * +*/ + +#include +#include +#include "testshareuimainwindow.h" + +int main(int argc, char *argv[]) +{ + // Application + HbApplication app(argc, argv); + + TestShareUiMainWindow* mainWin = new TestShareUiMainWindow(); + mainWin->init(); + mainWin->show(); + // Event loop + int error = app.exec(); + + // delete main window and return error + delete mainWin; + return error; +} + +// End of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/src/testshareuimainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/shareui/tsrc/testshareui/src/testshareuimainwindow.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,55 @@ +/* +* 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: Offers message creation and sending services. + * +*/ + +#include "testshareuimainwindow.h" +#include "testshareuiview.h" +#include + +TestShareUiMainWindow::TestShareUiMainWindow(QWidget *parent) + : HbMainWindow(parent) +{ + + + +} + +TestShareUiMainWindow::~TestShareUiMainWindow() +{ + +} + + +bool TestShareUiMainWindow::init() + { + qDebug() << "[CvProto.cpp] " << "init()"; + if((mView = new TestShareUiView(this)) == NULL) + { + qDebug() << "[CvProto.cpp] " << "DeviceView alloc failed"; + return false; + } + + if(!mView->init()) + { + qDebug() << "[CvProto.cpp] " << "DeviceView init failed"; + return false; + } + addView(mView); + setCurrentView(mView,false); + qDebug() << "[CvProto.cpp] " << "init() succeeded"; + return true; + + } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/src/testshareuiview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/shareui/tsrc/testshareui/src/testshareuiview.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,63 @@ +/* +* 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: Offers message creation and sending services. + * +*/ + +#include +#include +#include +#include +#include "testshareuiview.h" +#include "shareui.h" + +TestShareUiView::TestShareUiView(HbMainWindow* parent) + { + // TODO Auto-generated constructor stub + + } + +TestShareUiView::~TestShareUiView() + { + // TODO Auto-generated destructor stub + delete mDialog; + } + +bool TestShareUiView::init() + { + // initialize + qDebug() << "[DeviceView] " << "init()"; + mToolBar = toolBar(); + + // clear actions + mToolBar->clearActions(); + + // add the actions now + // when you press this, a device dialog should pop up. + HbAction* openCvAction = new HbAction( HbIcon(""), tr("Launch Share Ui"), this); + mToolBar->addAction(openCvAction); + connect(openCvAction, SIGNAL(triggered()), this, SLOT(openCvPop())); + + return true; + } + +void TestShareUiView::openCvPop() + { + qDebug() << "[DeviceView] " << "openCvPop() "; + mDialog = new ShareUi(); + QStringList fileList; + fileList << QString("c:\\Sunset.jpg"); + mDialog->send(fileList,true); + } + diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/testshareui.pro --- a/messagingapp/shareui/tsrc/testshareui/testshareui.pro Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/shareui/tsrc/testshareui/testshareui.pro Fri May 14 15:49:35 2010 +0300 @@ -17,27 +17,33 @@ TEMPLATE = app TARGET = testshareui -DEPENDPATH += . -INCLUDEPATH += . -INCLUDEPATH += ../../inc +DEPENDPATH += . inc src +INCLUDEPATH += inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - -QT += core -DEFINES+=_DEBUG CONFIG += hb -HEADERS += ./testshareuimainwindow.h \ - ./testshareuiview.h + + +TARGET.UID3 = 0x2002DD18 +TARGET.CAPABILITY = All -TCB +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 + +# Platforms +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +# Build.inf rules +BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " + + +# Input +HEADERS += testshareuimainwindow.h \ + testshareuiview.h SOURCES += main.cpp \ - testshareuimainwindow.cpp \ - testshareuiview.cpp - -LIBS += -lshareui + testshareuimainwindow.cpp \ + testshareuiview.cpp - -TARGET.CAPABILITY = ALL -TCB -TARGET.EPOCHEAPSIZE = 0x20000 0x25000 -symbian:TARGET.UID3 = 0x2002DD18 +# Libs +LIBS += -lshareui diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/testshareuimainwindow.cpp --- a/messagingapp/shareui/tsrc/testshareui/testshareuimainwindow.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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: Offers message creation and sending services. - * -*/ - -#include "testshareuimainwindow.h" -#include "testshareuiview.h" -#include - -TestShareUiMainWindow::TestShareUiMainWindow(QWidget *parent) - : HbMainWindow(parent) -{ - - - -} - -TestShareUiMainWindow::~TestShareUiMainWindow() -{ - -} - - -bool TestShareUiMainWindow::init() - { - qDebug() << "[CvProto.cpp] " << "init()"; - if((mView = new TestShareUiView(this)) == NULL) - { - qDebug() << "[CvProto.cpp] " << "DeviceView alloc failed"; - return false; - } - - if(!mView->init()) - { - qDebug() << "[CvProto.cpp] " << "DeviceView init failed"; - return false; - } - addView(mView); - setCurrentView(mView,false); - qDebug() << "[CvProto.cpp] " << "init() succeeded"; - return true; - - } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/testshareuimainwindow.h --- a/messagingapp/shareui/tsrc/testshareui/testshareuimainwindow.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +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: Offers message creation and sending services. - * -*/ - -#ifndef TESTSHAREUIMAINWINDOW_H -#define TESTSHAREUIMAINWINDOW_H - -#include - -class TestShareUiView; - - -class TestShareUiMainWindow : public HbMainWindow -{ - Q_OBJECT - -public: - TestShareUiMainWindow(QWidget *parent = 0); - ~TestShareUiMainWindow(); - bool init(); -private: - TestShareUiView* mView; - -}; - -#endif // SENDUITESTMAINWINDOW_H diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/testshareuiview.cpp --- a/messagingapp/shareui/tsrc/testshareui/testshareuiview.cpp Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: Offers message creation and sending services. - * -*/ - -#include -#include -#include -#include -#include "testshareuiview.h" -#include "shareui.h" - -TestShareUiView::TestShareUiView(HbMainWindow* parent) - { - // TODO Auto-generated constructor stub - - } - -TestShareUiView::~TestShareUiView() - { - // TODO Auto-generated destructor stub - } - -bool TestShareUiView::init() - { - // initialize - qDebug() << "[DeviceView] " << "init()"; - mToolBar = toolBar(); - - // clear actions - mToolBar->clearActions(); - - // add the actions now - // when you press this, a device dialog should pop up. - HbAction* openCvAction = new HbAction( HbIcon(""), tr("Launch Share Ui"), this); - mToolBar->addAction(openCvAction); - connect(openCvAction, SIGNAL(triggered()), this, SLOT(openCvPop())); - - return true; - } - -void TestShareUiView::openCvPop() - { - qDebug() << "[DeviceView] " << "openCvPop() "; - ShareUi dialog; - QList fileList; - fileList << QVariant(QString("c:\\Sunset.jpg")); - dialog.init(fileList,true); - } - diff -r 84d9eb65b26f -r e4592d119491 messagingapp/shareui/tsrc/testshareui/testshareuiview.h --- a/messagingapp/shareui/tsrc/testshareui/testshareuiview.h Mon May 03 12:29:07 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Offers message creation and sending services. - * -*/ - -#ifndef TESTSHAREUIVIEW_H_ -#define TESTSHAREUIVIEW_H_ - -#include -#include -#include - - -class TestShareUiView : public HbView - { - Q_OBJECT - -public: - TestShareUiView(HbMainWindow* parent = 0); - virtual ~TestShareUiView(); - bool init(); - -public slots: - - void openCvPop(); - -private: - HbToolBar* mToolBar; - }; - -#endif /* DEVICEVIEW_H_ */ diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/bwins/ringbcu.def --- a/messagingapp/smartmessaging/bwins/ringbcu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/bwins/ringbcu.def Fri May 14 15:49:35 2010 +0300 @@ -3,5 +3,4 @@ ?saveTone@RingBc@@QAEXABVQString@@@Z @ 2 NONAME ; void RingBc::saveTone(class QString const &) ??1RingBc@@QAE@XZ @ 3 NONAME ; RingBc::~RingBc(void) ??0RingBc@@QAE@XZ @ 4 NONAME ; RingBc::RingBc(void) - ?askSaveQuery@RingBc@@SA_NXZ @ 5 NONAME ; bool RingBc::askSaveQuery(void) diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/eabi/ringbcu.def --- a/messagingapp/smartmessaging/eabi/ringbcu.def Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/eabi/ringbcu.def Fri May 14 15:49:35 2010 +0300 @@ -1,9 +1,8 @@ EXPORTS - _ZN6RingBc12askSaveQueryEv @ 1 NONAME - _ZN6RingBc8saveToneERK7QString @ 2 NONAME - _ZN6RingBc9toneTitleERK7QString @ 3 NONAME - _ZN6RingBcC1Ev @ 4 NONAME - _ZN6RingBcC2Ev @ 5 NONAME - _ZN6RingBcD1Ev @ 6 NONAME - _ZN6RingBcD2Ev @ 7 NONAME + _ZN6RingBc8saveToneERK7QString @ 1 NONAME + _ZN6RingBc9toneTitleERK7QString @ 2 NONAME + _ZN6RingBcC1Ev @ 3 NONAME + _ZN6RingBcC2Ev @ 4 NONAME + _ZN6RingBcD1Ev @ 5 NONAME + _ZN6RingBcD2Ev @ 6 NONAME diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/ringbc/inc/ringbc.h --- a/messagingapp/smartmessaging/ringbc/inc/ringbc.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/ringbc/inc/ringbc.h Fri May 14 15:49:35 2010 +0300 @@ -63,12 +63,6 @@ */ QString toneTitle(const QString &path); - /** - * Asks the save query. - * @return bool true if user selected save else flase - */ - static bool askSaveQuery(); - private: /** diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/ringbc/inc/ringbc_p.h --- a/messagingapp/smartmessaging/ringbc/inc/ringbc_p.h Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/ringbc/inc/ringbc_p.h Fri May 14 15:49:35 2010 +0300 @@ -60,7 +60,7 @@ * @param path ringing tone file path. * @return error code */ - int saveToneL(const TDesC& aFileName); + void saveToneL(const QString& aFileName); /** * Returns title for the given ringing tone. diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/ringbc/src/ringbc.cpp --- a/messagingapp/smartmessaging/ringbc/src/ringbc.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/ringbc/src/ringbc.cpp Fri May 14 15:49:35 2010 +0300 @@ -72,19 +72,4 @@ return d_ptr->toneTitle(path); } -// ---------------------------------------------------------------------------- -// RingBc::askSaveQuery -// @see ringbc.h -// ---------------------------------------------------------------------------- -bool RingBc::askSaveQuery() - { - QDEBUG_WRITE("RingBc::~RingBc : Enter") - bool result =HbMessageBox::question("Save ringing tone ?", - "Save", - "Cancel"); - - QDEBUG_WRITE_FORMAT("RingBc::askSaveQuery Exit reslut:",result) - return result; - - } // End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp --- a/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Fri May 14 15:49:35 2010 +0300 @@ -80,11 +80,11 @@ void RingBcPrivate::saveTone(const QString &path) { QDEBUG_WRITE("RingBcPrivate::saveTone : Enter") - + int error(KErrNone); - HBufC* fileName = S60QConversions::qStringToS60Desc(path); - TRAP(error, error = saveToneL(*fileName)); - if(error) + + TRAP(error, saveToneL(path)); + if (error) { QDEBUG_WRITE_FORMAT("RingBcPrivate::saveTone Error code =",error) @@ -109,30 +109,110 @@ HbMessageBox::information("Saved succesfully"); QDEBUG_WRITE("RingBcPrivate::saveTone : Ringing tone saved successfully") } - - delete fileName; - + QDEBUG_WRITE("RingBcPrivate::saveTone : Exit") } - + // ---------------------------------------------------------------------------- // RingBcPrivate::saveToneL // @see ringbc_p.h // ---------------------------------------------------------------------------- -int RingBcPrivate::saveToneL(const TDesC& aFileName) +void RingBcPrivate::saveToneL(const QString& path) { QDEBUG_WRITE("RingBcPrivate::saveToneL : Enter") + + QStringList pathList = path.split("."); + QString extension = QString(".") + pathList.at(pathList.count() - 1); + + RFs fsSession; + User::LeaveIfError(fsSession.Connect()); + + CleanupClosePushL(fsSession); + + HBufC* fileName = S60QConversions::qStringToS60Desc(path); + + RFile file; + User::LeaveIfError(file.Open(fsSession, fileName->Des(), + EFileShareReadersOnly)); + + CleanupClosePushL(file); + TInt size; + User::LeaveIfError(file.Size(size)); + HBufC8* dataBuf = HBufC8::NewLC(size); + TPtr8 data(dataBuf->Des()); + User::LeaveIfError(file.Read(data, size)); + CleanupStack::PopAndDestroy(&file); + + TBool valid = mConverter->IsRingToneMimeTypeL(data); + + if (valid) + { + HBufC* title = mConverter->TitleLC(data); + TFileName path = PathInfo::PhoneMemoryRootPath(); + path.Append(PathInfo::SimpleSoundsPath()); + path.Append(*title); + HBufC* fileExtension = S60QConversions::qStringToS60Desc(extension); + path.Append(fileExtension->Des()); + + CFileMan* fileMan = CFileMan::NewL(fsSession); + CleanupStack::PushL(fileMan); + if(fileMan) + { + TInt err = fileMan->Copy(fileName->Des(), path, CFileMan::ECopy | CFileMan::EOverWrite); + User::LeaveIfError(err); + } + CleanupStack::PopAndDestroy(2); // title,fileMan + } + + CleanupStack::PopAndDestroy(); // dataBuf + CleanupStack::PopAndDestroy(); //fsSession + + + QDEBUG_WRITE("RingBcPrivate::saveToneL : Exit") + } + +// ---------------------------------------------------------------------------- +// RingBcPrivate::toneTitle +// @see ringbc_p.h +// ---------------------------------------------------------------------------- +QString RingBcPrivate::toneTitle(const QString &path) + { + QDEBUG_WRITE("RingBcPrivate::toneTitle : Enter") + + QString title; + QStringList pathList = path.split("."); + QString extension = pathList.at(pathList.count() - 1); + + HBufC* fileName = S60QConversions::qStringToS60Desc(path); + TRAP_IGNORE( title = titleL(*fileName)); + + title.append(QChar('.')); + title.append(extension); + + QDEBUG_WRITE("RingBcPrivate::toneTitle : Exit") + return title; + } + +// ---------------------------------------------------------------------------- +// RingBcPrivate::titleL +// @see ringbc_p.h +// ---------------------------------------------------------------------------- +QString RingBcPrivate::titleL(const TDesC& aFileName) + { + QDEBUG_WRITE("RingBcPrivate::titleL : Enter") + + QString title; // initialize to null string RFs fsSession; TInt error = fsSession.Connect(); - if( error == KErrNone) + if (error == KErrNone) { CleanupClosePushL(fsSession); RFile file; - error = file.Open(fsSession,aFileName, EFileRead); + error = file.Open(fsSession, aFileName, EFileRead); - if(error == KErrNone) + if (error == KErrNone) { CleanupClosePushL(file); TInt size; @@ -141,97 +221,23 @@ { HBufC8* dataBuf = HBufC8::NewLC(size); TPtr8 data(dataBuf->Des()); - User::LeaveIfError(file.Read(data, size)); - - TBool valid = mConverter->IsRingToneMimeTypeL(data); - if(valid) - { - HBufC* title = mConverter->TitleLC(data); - TFileName path = PathInfo::PhoneMemoryRootPath(); - path.Append( PathInfo::SimpleSoundsPath() ); - path.Append(*title); - path.Append(KRingingToneFileExtension); + User::LeaveIfError(file.Read(data, size)); - CFileMan* fileMan = CFileMan::NewL(fsSession); - CleanupStack::PushL( fileMan ); - error = fileMan->Copy( file, path ); - CleanupStack::PopAndDestroy(2); // title,fileMan + TBool valid = mConverter->IsRingToneMimeTypeL(data); + if (valid) + { + HBufC* toneTitle = mConverter->TitleLC(data); + title = S60QConversions::s60DescToQString(*toneTitle); + CleanupStack::PopAndDestroy(); //title } - else - { - error = KErrCorrupt; - } - CleanupStack::PopAndDestroy(); // dataBuf - } + CleanupStack::PopAndDestroy(); //dataBuf + } CleanupStack::PopAndDestroy(); //file } CleanupStack::PopAndDestroy(); //fsSession } - - QDEBUG_WRITE("RingBcPrivate::saveToneL : Exit") - return error; + QDEBUG_WRITE("RingBcPrivate::titleL : Exit") + return title; } -// ---------------------------------------------------------------------------- -// RingBcPrivate::toneTitle -// @see ringbc_p.h -// ---------------------------------------------------------------------------- - QString RingBcPrivate::toneTitle(const QString &path) - { - QDEBUG_WRITE("RingBcPrivate::toneTitle : Enter") - - QString title; - HBufC* fileName = S60QConversions::qStringToS60Desc(path); - TRAP_IGNORE( title = titleL(*fileName)); - - QDEBUG_WRITE("RingBcPrivate::toneTitle : Exit") - return title; - } - - // ---------------------------------------------------------------------------- - // RingBcPrivate::titleL - // @see ringbc_p.h - // ---------------------------------------------------------------------------- - QString RingBcPrivate::titleL(const TDesC& aFileName) - { - QDEBUG_WRITE("RingBcPrivate::titleL : Enter") - - QString title; // initialize to null string - RFs fsSession; - TInt error = fsSession.Connect(); - if( error == KErrNone) - { - CleanupClosePushL(fsSession); - - RFile file; - error = file.Open(fsSession,aFileName, EFileRead); - - if(error == KErrNone) - { - CleanupClosePushL(file); - TInt size; - User::LeaveIfError(file.Size(size)); - if (size) - { - HBufC8* dataBuf = HBufC8::NewLC(size); - TPtr8 data(dataBuf->Des()); - User::LeaveIfError(file.Read(data, size)); - - TBool valid = mConverter->IsRingToneMimeTypeL(data); - if(valid) - { - HBufC* toneTitle = mConverter->TitleLC(data); - title = S60QConversions::s60DescToQString(*toneTitle); - CleanupStack::PopAndDestroy(); //title - } - CleanupStack::PopAndDestroy(); //dataBuf - } - CleanupStack::PopAndDestroy(); //file - } - CleanupStack::PopAndDestroy(); //fsSession - } - QDEBUG_WRITE("RingBcPrivate::titleL : Exit") - return title; - } - // End of File diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/msgapptestsuite/msgapptestsuite.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/msgapptestsuite/msgapptestsuite.cfg Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,1 @@ +TConversationEngine \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/msgapptestsuite/msgapptestsuite.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/msgapptestsuite/msgapptestsuite.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,48 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +QT += testlib +QT -= gui + +CONFIG += symbian_test + +TEMPLATE = app +TARGET = MsgAppTestSuite +TARGET.CAPABILITY = All -TCB -DRM +DEPENDPATH += . +INCLUDEPATH += . +INCLUDEPATH += ../../msgui/appengine/tsrc +INCLUDEPATH += ../../msgui/appengine/tsrc/testconversationengine/inc + + +# Input +SOURCES += src/main.cpp + +SYMBIAN_PLATFORMS = WINSCW ARMV5 +symbian { + TARGET.UID3 = 0x2001FE76 + TARGET.EPOCSTACKSIZE = 0x8000 + TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 + BLD_INF_RULES.prj_testexports += "msgapptestsuite.cfg c:/msgapptestsuite.cfg" + BLD_INF_RULES.prj_testexports += "msgapptestsuitreport.pl c:/msgapptestsuitreport.pl" + + testdll.sources = testconversationengine.dll + testdll.path = /sys/bin + DEPLOYMENT += testdll + } + +LIBS += \ + -ltestconversationengine \ \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/msgapptestsuite/msgapptestsuitreport.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/msgapptestsuite/msgapptestsuitreport.pl Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,182 @@ +# +# 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: +# +#!/usr/bin/perl -w +use warnings; +use strict; + +my $TOTALCASES = 0; +my $TOTALPASSED = 0; +my $TOTALRUN = 0; +my $TOTALFAILED = 0; +my $TOTALSKIPPED = 0; + +sub parse_line +{ + my $line = $_[0]; + my @parts = split (" ", $line); + my $passed = $parts[1]; + my $failed = $parts[3]; + my $skipped = $parts[5]; + + my $total = $passed + $failed + $skipped; + my $passrate = $passed * 100 / $total; + my $passrateround = sprintf("%.0f",$passrate); + my $runrate = ($total - $skipped)*100/$total; + my $runrateround = sprintf("%.0f",$runrate); + + $TOTALCASES += $total; + $TOTALPASSED += $passed; + $TOTALRUN += ($total - $skipped); + $TOTALFAILED += $failed; + $TOTALSKIPPED += $skipped; + + printf MYFILE "\n"; + printf MYFILE "$passed\n"; + printf MYFILE "\n"; + + if($failed > 0) + { + printf MYFILE "\n"; + printf MYFILE "$failed\n"; + printf MYFILE "\n"; + } + else + { + printf MYFILE "\n"; + printf MYFILE "$failed\n"; + printf MYFILE "\n"; + } + + printf MYFILE "\n"; + printf MYFILE "$skipped\n"; + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE "$total\n"; + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE ("$passrateround %%\n"); + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE "$runrateround %%\n"; + printf MYFILE "\n"; + + +} + +sub parse_file + { + my $pattern = "Totals"; + my $file = $_[0]; + open (FILE,$file); + + while (my $line= ) + { + chomp ($line); + if ($line =~ m/$pattern/) + { + parse_line $line; + } + } + close(FILE); + } + + +sub generate_report + { + open (MYFILE, '>/epoc32/winscw/c/logs/messagingtestsuite/report.html'); + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "MsgApp Test Suite Reports"; + printf MYFILE "\n"; + printf MYFILE "

Messaging Test Suite Report

\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + + + my @files = ; + foreach my $file (@files) + { + my @splitedpath = split("/",$file); + my $filename = $splitedpath[-1]; + my $length = length($filename); + my $name = substr($filename,11,$length-15); + printf MYFILE "\n"; + printf MYFILE "\n"; + + parse_file $file; + + printf MYFILE "\n"; + } + + printf MYFILE "\n"; + printf MYFILE "\n"; + + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + my $passrate = $TOTALPASSED*100/$TOTALCASES; + my $passrateround = sprintf("%.0f",$passrate); + printf MYFILE "\n"; + + my $runrate = ($TOTALCASES - $TOTALSKIPPED)*100/$TOTALCASES; + my $runrateround = sprintf("%.0f",$runrate); + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "
ModulePassedFailedSkippedTotal CasesPass RateRun Rate
\n"; + printf MYFILE "$name\n"; + printf MYFILE "
\n"; + printf MYFILE "Overall\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALPASSED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALFAILED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALSKIPPED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALCASES\n"; + printf MYFILE "\n"; + printf MYFILE "$passrateround%%\n"; + printf MYFILE "\n"; + printf MYFILE "$runrateround%%\n"; + printf MYFILE "
\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + + close (MYFILE); + } + + +generate_report; \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/msgapptestsuite/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/msgapptestsuite/src/main.cpp Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,95 @@ +/* + * 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: main class for msgapptestsuite. + */ + +#include +#include "testconversationengine.h" + +//out put directory for test results. +QString OUTPUTDIRECTORY = "c:/logs/messagingtestsuite"; +//o/p directory for data to be written on temp file. +QString TEMPDIR = "c:/logs/messagingtestsuite/testdata"; +//test result O/P file name. +QString RESULTFILE = "c:/logs/messagingtestsuite/result_%1.txt"; +// folder named UID3 of msgapptestsuite inside private folder. +const QString PRIVATE_DIR("C:/private/2001fe76"); + +//factory method to create objects. +QObject* getObject(QString className) +{ + if(className == "TConversationEngine" ) + { + return new TConversationEngine(); + } + else + { + return 0; + } +} + +//creating o/p directory. +void createOutPutDirectory() + { + QDir dir; + //o/p dir + dir.mkdir(OUTPUTDIRECTORY); + //tmp dir + dir.mkdir(TEMPDIR); + // dir inside private folder. + dir.mkdir(PRIVATE_DIR); + } + +//main entry point +int main(int argc, char *argv[]) + { + int ret = -1; + QCoreApplication app(argc, argv); + + //creating output directory. + createOutPutDirectory(); + + //the configuration file. + QFile data("c:/msgapptestsuite.cfg"); + + if (data.open(QFile::ReadOnly)) + { + QTextStream in(&data); + while(!in.atEnd()) + { + QStringList args; + QString appName = argv[0]; + args << appName; + + QString option = "-o"; + args << option; + + QString outFile = RESULTFILE; + QString name = in.readLine(); + outFile = outFile.arg(name); + args << outFile; + + QObject* tc = getObject(name); + + if(tc) + { + + ret = QTest::qExec(tc, args); + delete tc; + } + } + } + data.close(); + return ret; + } diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/testapp.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/testapp.bat Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,27 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@ECHO off +CLS +ECHO ...Running Test cases +CALL /epoc32/RELEASE/WINSCW/udeb/MsgAppTestSuite.exe -dtextshell -- +ECHO ... + +ECHO ...Generating Report. +CALL perl /epoc32/winscw/c/msgapptestsuitreport.pl +ECHO ...Done + +CALL /epoc32/winscw/c/logs/messagingtestsuite/report.html \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 messagingapp/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/tsrc/tsrc.pro Fri May 14 15:49:35 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +CONFIG += symbian_test + +SUBDIRS += ../msgui/appengine/tsrc/testconversationengine/testconversationengine.pro +SUBDIRS += msgapptestsuite/msgapptestsuite.pro + +CONFIG += ordered \ No newline at end of file diff -r 84d9eb65b26f -r e4592d119491 msg_plat/conversation_services_utilities_api/inc/ccsdefs.h --- a/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Mon May 03 12:29:07 2010 +0300 +++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Fri May 14 15:49:35 2010 +0300 @@ -283,6 +283,21 @@ */ const TInt KSimIdOffset = 99999; +/** + * @typedef TCsMsgPreviewProperty + */ + +enum +{ + EPreviewNone = 0x00, + EPreviewImage = 0x01, + EPreviewAudio = 0x02, + EPreviewVideo = 0x04, + EPreviewAttachment = 0x08 +}; + +typedef TUint8 TCsMsgPreviewProperty; + #endif // __C_CSSERVER_DEFS_H__ // End of file diff -r 84d9eb65b26f -r e4592d119491 msg_plat/shareui_api/inc/shareui.h --- a/msg_plat/shareui_api/inc/shareui.h Mon May 03 12:29:07 2010 +0300 +++ b/msg_plat/shareui_api/inc/shareui.h Fri May 14 15:49:35 2010 +0300 @@ -37,6 +37,8 @@ /** * This class offers message creation and sending services. + * this class inturn launches HbDialog with list of services asynchronously + * object should be alive till dialog handled completely.so client should create this class instance as a member variable */ class SHAREUI_EXPORT ShareUi {