source: SMSSender/src/ui/models/contactgroupmodel.h @ 43:10dd65d71f7f

3.0
Last change on this file since 43:10dd65d71f7f was 43:10dd65d71f7f, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Did a lot of work...
File size: 1.3 KB
Line 
1#ifndef UI_CONTACTGROUPMODEL_H
2#define UI_CONTACTGROUPMODEL_H
3
4#include <QObject>
5#include <QAbstractListModel>
6#include <QList>
7#include <QSet>
8
9#include <icontact.h>
10#include <igroup.h>
11#include "../../business/BCContactManager.h"
12#include "../../business/BCGroupManager.h"
13
14class ContactGroupListModel: public QAbstractListModel {
15    Q_OBJECT
16
17public:
18    ContactGroupListModel(QObject* parent = 0);
19    ~ContactGroupListModel();
20
21    QVariant      data(const QModelIndex& index, int role = Qt::DisplayRole) const;
22    int           columnCount(const QModelIndex& parent = QModelIndex()) const;
23    int           rowCount(const QModelIndex& parent = QModelIndex()) const;
24
25    IInterface*   dataObject(const QModelIndex& index) const;
26
27    void          addFilteredContact(IContact* contact);
28    void          removeFilteredContact(IContact* contact);
29
30private slots:
31    void dataUpdated(IContact* contact);
32    void dataUpdated(IGroup* group);
33
34private:
35    QList<IInterface*> items_;
36    QSet<IInterface*> filteredItems_;
37
38    QSet<IGroup*>   groups() const;
39    QSet<IContact*> contacts() const;
40    QSet<IGroup*>   filteredGroups() const;
41    QSet<IContact*> filteredContacts() const;
42
43    void            reloadList();
44    void            dataUpdated(IInterface* contactOrGroup);
45};
46
47
48#endif // UI_CONTACTGROUPMODEL_H
49
Note: See TracBrowser for help on using the repository browser.