messagingapp/msgappfw/server/inc/ccscontactsresolver.h
changeset 31 ebfee66fde93
child 47 5b14749788d7
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: QT contact resolver interface
       
    15  *
       
    16  */
       
    17 #ifndef CONTACTS_RESOLVER_H
       
    18 #define CONTACTS_RESOLVER_H
       
    19 
       
    20 // SYSTEM INCLUDES
       
    21 #include <QObject>
       
    22 #include <QStringList>
       
    23 #include <qtcontactsglobal.h>
       
    24 
       
    25 //USER INCLUDES
       
    26 
       
    27 QTM_BEGIN_NAMESPACE
       
    28 //FORAWRD DELCARATIONS
       
    29 class QContactManager;
       
    30 QTM_END_NAMESPACE
       
    31 
       
    32 
       
    33 QTM_USE_NAMESPACE
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  *  CCsContactDetail class holds the details obtained from the phonebook
       
    39  *  for a given contact 
       
    40  */
       
    41 class CCsContactDetail
       
    42 {
       
    43 public:
       
    44     
       
    45 	/**
       
    46 	 * Constructor
       
    47 	 */
       
    48     CCsContactDetail():contactId(-1),displayName(QString()){};
       
    49     
       
    50 public:
       
    51     int contactId;
       
    52 	QString displayName;
       
    53 	QStringList addressList;
       
    54 };
       
    55 
       
    56 /**
       
    57  *  QT contact resolver interface, Gets ConvergedMessageAddress from 
       
    58  *  conversation harvester and resolves the address to an entry in the 
       
    59  *  contacts database and returns required phonebook
       
    60  *  details to be updated to conversation DB
       
    61  */
       
    62 class CCsContactsResolver
       
    63 {
       
    64 public: 
       
    65 
       
    66 	/**
       
    67 	 * Constructor
       
    68 	 */
       
    69 	explicit CCsContactsResolver(QContactManager* manager);
       
    70 
       
    71 	/**
       
    72 	 * Destructor
       
    73 	 */
       
    74 	virtual ~CCsContactsResolver();
       
    75 
       
    76 	/**
       
    77 	 * resolveContact
       
    78 	 * Resolve contact from phonebook and fill contact 
       
    79 	 * details in contactDetail object  
       
    80 	 * 
       
    81 	 * @param address ConvergedMessageAddress object 
       
    82 	 * @param contactDetail ContactDetail object
       
    83 	 */ 
       
    84 	bool resolveContact(const QString &address,
       
    85 	                     CCsContactDetail &contactDetail);
       
    86 
       
    87 	/**
       
    88 	 * resolveContactId
       
    89 	 * Resolve contactId from phonebook and fill contact 
       
    90 	 * details in contactDetail object  
       
    91 	 * 
       
    92 	 * @param id quint32 contact id
       
    93 	 * @param contactDetail ContactDetail object 
       
    94 	 */ 
       
    95 	void resolveContactId(const quint32 &contactId,
       
    96 	                         CCsContactDetail &contactDetail);	
       
    97 	
       
    98 private:
       
    99 	
       
   100     /**
       
   101      * mPhonebookManager
       
   102      * An instance of the QContactManager
       
   103      */
       
   104     QContactManager* mPhonebookManager;    
       
   105 
       
   106 };
       
   107 
       
   108 #endif // CONTACTS_RESOLVER_H
       
   109 
       
   110 // EOF
       
   111