2 ChatSessionMembersListModel
4 Copyright (c) 2007 by Duncan Mac-Vicar Prett <duncan@kde.org>
6 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
10 * This library is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU Lesser General Public *
12 * License as published by the Free Software Foundation; either *
13 * version 2 of the License, or (at your option) any later version. *
15 *************************************************************************
18 #ifndef Kopete_ChatSessionMembersListModel_H
19 #define Kopete_ChatSessionMembersListModel_H
21 #include <QAbstractListModel>
23 #include "kopetechatsession.h"
24 #include "kopete_export.h"
26 class Kopete::Contact
;
31 class KOPETE_EXPORT ChatSessionMembersListModel
: public QAbstractListModel
35 explicit ChatSessionMembersListModel(QObject
* parent
= 0);
38 int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
39 QVariant
data(const QModelIndex
&index
, int role
) const;
40 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
41 Kopete::ChatSession
*session() { return m_session
; }
43 Kopete::Contact
*contactAt( const QModelIndex
&index
) const;
46 * Called when the ChatSession change for this list (eg. when the tab in the KopeteChatWindow is changing)
48 void setChatSession(Kopete::ChatSession
*session
);
52 * Called when a contact is added to the chat session.
53 * Adds this contact to the contact list view.
54 * @param c The contact that joined the chat
56 void slotContactAdded( const Kopete::Contact
*c
);
59 * Called when a contact is removed from the chat session.
60 * Removes this contact from the contact list view.
61 * @param c The contact that left the chat
63 void slotContactRemoved( const Kopete::Contact
*c
);
66 * Called when a contact changes status.
67 * @param contact The contact who changed status
68 * @param status The new status of the contact
70 void slotContactStatusChanged( Kopete::Contact
*contact
, const Kopete::OnlineStatus
&status
);
73 * Called when something in the session changed that requires a full
76 void slotSessionChanged();
79 * Called when session has been closed
81 void slotSessionClosed();
84 Kopete::ChatSession
*m_session
;