aboutsummaryrefslogtreecommitdiffstats
path: root/attachmenttablemodel.h
blob: 560df1312a4eddc7875daf3844e574b87de60299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef ATTACHMENTTABLEMODEL_H
#define ATTACHMENTTABLEMODEL_H

#include "mime.h"
#include <QIcon>
#include <QFile>
#include <QAbstractTableModel>

class QStandardItem;

class AttachmentTableModel : public QAbstractTableModel
{
    Q_OBJECT

public:
    AttachmentTableModel(QObject *parent = 0);
    AttachmentTableModel(QString iconpath, QObject *parent = 0);
    AttachmentTableModel(QList<MimePart> mimeparts, QObject *parent = 0);

    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    void add(MimePart mp);
    MimePart getSelectedMimePart(QModelIndex index);
    MimePart getMimePart(int index);
    //QList<MimePart> getSelectedMimeParts(QModelIndexList indexes);

private:
    QList<MimePart> listOfMimeparts;
    QString iconPath;

};

#endif // ATTACHMENTTABLEMODEL_H