Messagelib

mimetreemodel.h
1/*
2 SPDX-FileCopyrightText: 2007 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QAbstractItemModel>
10#include <memory>
11namespace KMime
12{
13class Content;
14}
15
16namespace MessageViewer
17{
18/**
19 A model representing the mime part tree of a message.
20*/
22{
24
25public:
26 enum Role {
27 ContentIndexRole = Qt::UserRole + 1,
28 ContentRole,
29 MimeTypeRole,
30 MainBodyPartRole,
31 AlternativeBodyPartRole,
32 UserRole = Qt::UserRole + 100,
33 };
34 explicit MimeTreeModel(QObject *parent = nullptr);
35 ~MimeTreeModel() override;
36
37 void setRoot(KMime::Content *root);
38
39 KMime::Content *root();
40
41 [[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
42 [[nodiscard]] QModelIndex parent(const QModelIndex &index) const override;
43 [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
44 [[nodiscard]] int columnCount(const QModelIndex &parent = QModelIndex()) const override;
45 [[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
46 [[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
47 QMimeData *mimeData(const QModelIndexList &indexes) const override;
48 [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
49 [[nodiscard]] QStringList mimeTypes() const override;
50
51private:
52 class MimeTreeModelPrivate;
53 std::unique_ptr<MimeTreeModelPrivate> const d;
54};
55}
A model representing the mime part tree of a message.
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
typedef ItemFlags
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.