source: SMSSender/src/ui/models/accounttreemodel.h @ 67:578192d6fe64

3.0
Last change on this file since 67:578192d6fe64 was 67:578192d6fe64, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • added synchttp
  • backup before removing these diamond interfaces...
File size: 1.3 KB
Line 
1#ifndef UI_ACCOUNTTREEMODEL_H
2#define UI_ACCOUNTTREEMODEL_H
3
4#include <QObject>
5#include <QAbstractTableModel>
6
7#include <iaccount.h>
8#include "../../business/BCAccountManager.h"
9
10class AccountTreeModel: public QAbstractTableModel {
11    Q_OBJECT
12
13public:
14    AccountTreeModel(QObject* parent = 0);
15    ~AccountTreeModel();
16
17    enum Columns {
18        ColEnabled     = 0,
19        ColName        = 1,
20        ColGatewayName = 2,
21
22        MaxCol         = ColGatewayName
23    };
24
25    QVariant      headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
26    QVariant      data(const QModelIndex& index, int role = Qt::DisplayRole) const;
27    int           columnCount(const QModelIndex& parent = QModelIndex()) const;
28    int           rowCount(const QModelIndex& parent = QModelIndex()) const;
29    bool          removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
30    Qt::ItemFlags flags(const QModelIndex& index) const;
31    bool          setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
32
33    IAccount*     dataObject(const QModelIndex& index) const;
34
35public slots:
36    void accountUpdated(IAccount* account);
37    void listAltered();
38
39private:
40    QList<IAccount*> items_;
41
42    void          reloadList();
43};
44
45
46#endif // UI_ACCOUNTTREEMODEL_H
47
Note: See TracBrowser for help on using the repository browser.