kopete/libkopete
chatsessionmemberslistmodel.h
Go to the documentation of this file.00001 /* 00002 ChatSessionMembersListModel 00003 00004 Copyright (c) 2007 by Duncan Mac-Vicar Prett <duncan@kde.org> 00005 00006 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org> 00007 00008 ************************************************************************* 00009 * * 00010 * This library is free software; you can redistribute it and/or * 00011 * modify it under the terms of the GNU Lesser General Public * 00012 * License as published by the Free Software Foundation; either * 00013 * version 2 of the License, or (at your option) any later version. * 00014 * * 00015 ************************************************************************* 00016 */ 00017 00018 #ifndef Kopete_ChatSessionMembersListModel_H 00019 #define Kopete_ChatSessionMembersListModel_H 00020 00021 #include <QAbstractListModel> 00022 00023 #include "kopetechatsession.h" 00024 #include "kopete_export.h" 00025 00026 namespace Kopete 00027 { 00028 00029 class Contact; 00030 00031 class KOPETE_EXPORT ChatSessionMembersListModel : public QAbstractListModel 00032 { 00033 Q_OBJECT 00034 public: 00035 explicit ChatSessionMembersListModel(QObject * parent = 0); 00036 00037 // Model methods 00038 int rowCount(const QModelIndex &parent = QModelIndex()) const; 00039 QVariant data(const QModelIndex &index, int role) const; 00040 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 00041 Kopete::ChatSession *session() { return m_session; } 00042 00043 Kopete::Contact *contactAt( const QModelIndex &index ) const; 00044 public slots: 00048 void setChatSession(Kopete::ChatSession *session); 00049 00050 private slots: 00056 void slotContactAdded( const Kopete::Contact *c ); 00057 00063 void slotContactRemoved( const Kopete::Contact *c ); 00064 00070 void slotContactStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &status ); 00071 00076 void slotSessionChanged(); 00077 00081 void slotSessionClosed(); 00082 00083 private: 00084 Kopete::ChatSession *m_session; 00085 }; 00086 00087 00088 } 00089 00090 #endif 00091
KDE 4.2 API Reference