summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistmodel.h
blob: 72a26c59434b7c3a2f1829ebdb28411748f79a7d (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
#pragma once

#include <QAbstractListModel>
#include <QStringList>

class MailListModel : public QAbstractListModel
{
    Q_OBJECT

public:
    MailListModel(QObject *parent = Q_NULLPTR);
    ~MailListModel();

    enum Roles {
        Subject  = Qt::UserRole + 1
    };

    QHash<int, QByteArray> roleNames() const;
    QVariant data(const QModelIndex &index, int role) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;

    bool addMails(const QStringList &items);
    void clearMails();

    void runQuery(const QString &query);

private:
    QStringList m_msgs;
};