diff -r fa1df4b99609 -r ebe688cedc25 messagingapp/msgappfw/server/inc/ccscontactsresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/server/inc/ccscontactsresolver.h Tue Aug 31 15:11:31 2010 +0300 @@ -0,0 +1,111 @@ +/* + * 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 contact resolver interface + * + */ +#ifndef CONTACTS_RESOLVER_H +#define CONTACTS_RESOLVER_H + +// SYSTEM INCLUDES +#include +#include +#include + +//USER INCLUDES + +QTM_BEGIN_NAMESPACE +//FORAWRD DELCARATIONS +class QContactManager; +QTM_END_NAMESPACE + + +QTM_USE_NAMESPACE + +// CLASS DECLARATION + +/** + * CCsContactDetail class holds the details obtained from the phonebook + * for a given contact + */ +class CCsContactDetail +{ +public: + + /** + * Constructor + */ + CCsContactDetail():contactId(-1),displayName(QString()){}; + +public: + int contactId; + QString displayName; + QStringList addressList; +}; + +/** + * QT contact resolver interface, Gets ConvergedMessageAddress from + * conversation harvester and resolves the address to an entry in the + * contacts database and returns required phonebook + * details to be updated to conversation DB + */ +class CCsContactsResolver +{ +public: + + /** + * Constructor + */ + explicit CCsContactsResolver(QContactManager* manager); + + /** + * Destructor + */ + virtual ~CCsContactsResolver(); + + /** + * resolveContact + * Resolve contact from phonebook and fill contact + * details in contactDetail object + * + * @param address ConvergedMessageAddress object + * @param contactDetail ContactDetail object + */ + bool resolveContact(const QString &address, + CCsContactDetail &contactDetail); + + /** + * resolveContactId + * Resolve contactId from phonebook and fill contact + * details in contactDetail object + * + * @param id quint32 contact id + * @param contactDetail ContactDetail object + */ + void resolveContactId(const quint32 &contactId, + CCsContactDetail &contactDetail); + +private: + + /** + * mPhonebookManager + * An instance of the QContactManager + */ + QContactManager* mPhonebookManager; + +}; + +#endif // CONTACTS_RESOLVER_H + +// EOF +