phonebookui/pbkcommonui/inc/cntpresencelistener.h
changeset 46 efe85016a067
child 50 77bc263e1626
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CNTPRESENCELISTENER_H
       
    19 #define CNTPRESENCELISTENER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <qtcontacts.h>
       
    23 #include <QMap>
       
    24 
       
    25 class PrcPresenceReader;
       
    26 class PrcPresenceBuddyInfoQt;
       
    27 
       
    28 QTM_BEGIN_NAMESPACE
       
    29 class QContact;
       
    30 QTM_END_NAMESPACE
       
    31 
       
    32 QTM_USE_NAMESPACE
       
    33 
       
    34 class CntPresenceListener : public QObject
       
    35 {
       
    36     friend class TestCntPresenceListener;
       
    37     
       
    38     Q_OBJECT
       
    39     
       
    40 public:
       
    41     CntPresenceListener(const QContact& contact, QObject* parent = NULL);
       
    42     ~CntPresenceListener();
       
    43     
       
    44     QMap<QString, bool> initialPresences(bool &combinedOnlineStatus);
       
    45     
       
    46 private slots:
       
    47     void handlePresenceUpdate(bool aSuccess, PrcPresenceBuddyInfoQt* aPresenceBuddyInfo);
       
    48     
       
    49 private:
       
    50     bool parsePresence(QList<PrcPresenceBuddyInfoQt*> buddyList);
       
    51     
       
    52 signals:
       
    53     void accountPresenceUpdated(QString accountUri, bool online);
       
    54     void fullPresenceUpdated(bool online);
       
    55     
       
    56 private:
       
    57     PrcPresenceReader*  mReader; // own
       
    58     QStringList         mAccountList;
       
    59     
       
    60     const QContact&     mContact;
       
    61     
       
    62 };
       
    63 
       
    64 #endif // CNTPRESENCELISTENER_H