phonebookengines/cntlistmodel/inc/cntpresenceinfoprovider.h
changeset 46 efe85016a067
child 61 d30183af6ca6
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
       
     1 /*
       
     2 * Copyright (c) 2010 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: Presence info provider plugin for CntListModel. It can provide
       
    15 *              the presence information of a contact (icon2 field).
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CNTPRESENCEINFOPROVIDER_H
       
    20 #define CNTPRESENCEINFOPROVIDER_H
       
    21 
       
    22 #include "cntinfoprovider.h"
       
    23 #include <qcontact.h>
       
    24 
       
    25 class PrcPresenceReader;
       
    26 class PrcPresenceBuddyInfoQt;
       
    27 
       
    28 QTM_BEGIN_NAMESPACE
       
    29 class QContactManager;
       
    30 QTM_END_NAMESPACE
       
    31 
       
    32 QTM_USE_NAMESPACE
       
    33 
       
    34 /**
       
    35     Presence info provider plugin for CntListModel. It can provide
       
    36     the presence information of a contact (icon2 field).
       
    37  */
       
    38 class CntPresenceInfoProvider : public CntInfoProvider
       
    39 {
       
    40     friend class TestCntPresenceInfoProvider;
       
    41     Q_OBJECT
       
    42     
       
    43 public:
       
    44     CntPresenceInfoProvider();
       
    45     ~CntPresenceInfoProvider();
       
    46     
       
    47 	// From CntInfoProvider
       
    48     QString id() const { return "presence"; };
       
    49     ContactInfoFields supportedFields() const;
       
    50     void requestInfo(const QContact& contact, ContactInfoFields requestedInfo);
       
    51     
       
    52 private slots:
       
    53     void handlePresenceUpdate(bool aSuccess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo);
       
    54     
       
    55 private:
       
    56     QString parsePresence(const QList<PrcPresenceBuddyInfoQt*>& buddyList);
       
    57     
       
    58 private:
       
    59     PrcPresenceReader*              iReader; // owned
       
    60     QContactManager*                mManager; // owned
       
    61     QMap<QString, QContactLocalId>  mBuddyMap;
       
    62 };
       
    63 
       
    64 #endif