~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to src/tools/contactlist/contactlistmodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CONTACTLISTMODEL_H
 
2
#define CONTACTLISTMODEL_H
 
3
 
 
4
#include <QAbstractItemModel>
 
5
#include <QModelIndex>
 
6
#include <QVariant>
 
7
 
 
8
class ContactList;
 
9
 
 
10
class ContactListModel : public QAbstractItemModel
 
11
{
 
12
        Q_OBJECT
 
13
 
 
14
public:
 
15
        enum {
 
16
                ExpandedRole = Qt::UserRole + 0,
 
17
                ContextMenuRole = Qt::UserRole + 1
 
18
        };
 
19
        enum {
 
20
                StatusIconColumn = 0,
 
21
                NameColumn = 1,
 
22
                PictureColumn = 2
 
23
        };
 
24
 
 
25
        ContactListModel(ContactList* contactList);
 
26
 
 
27
        // Reimplemented from QAbstratItemModel
 
28
        QVariant data(const QModelIndex &index, int role) const;
 
29
        QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
 
30
        virtual QModelIndex index(int row, int column, const QModelIndex &parent) const;
 
31
        virtual QModelIndex parent(const QModelIndex &index) const;
 
32
        virtual int rowCount(const QModelIndex &parent) const;
 
33
        virtual int columnCount(const QModelIndex &parent) const;
 
34
        Qt::ItemFlags flags(const QModelIndex& index) const;
 
35
        virtual bool setData(const QModelIndex&, const QVariant&, int role);
 
36
 
 
37
protected slots:
 
38
        void contactList_changed();
 
39
 
 
40
private:
 
41
        ContactList* contactList_;
 
42
        bool showStatus_;
 
43
};
 
44
 
 
45
#endif