Mailcommon

foldertreewidgetproxymodel.h
1/*
2 SPDX-FileCopyrightText: 2009-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "mailcommon_export.h"
10
11#include <Akonadi/Collection>
12#include <Akonadi/EntityRightsFilterModel>
13#include <memory>
14
15namespace MailCommon
16{
17/**
18 * @brief The FolderTreeWidgetProxyModel class
19 * @author Laurent Montel <montel@kde.org>
20 */
22{
23 Q_OBJECT
24
25public:
26 enum FolderTreeWidgetProxyModelOption { None = 0, HideVirtualFolder = 1, HideSpecificFolder = 2, HideOutboxFolder = 4 };
27 Q_DECLARE_FLAGS(FolderTreeWidgetProxyModelOptions, FolderTreeWidgetProxyModelOption)
28
29 explicit FolderTreeWidgetProxyModel(QObject *parent = nullptr, FolderTreeWidgetProxyModelOptions = FolderTreeWidgetProxyModel::None);
30
32
33 [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
34
35 [[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
36
37 void setEnabledCheck(bool enable);
38 [[nodiscard]] bool enabledCheck() const;
39
40 void setHideVirtualFolder(bool exclude);
41 [[nodiscard]] bool hideVirtualFolder() const;
42
43 void setHideSpecificFolder(bool hide);
44 [[nodiscard]] bool hideSpecificFolder() const;
45
46 void setHideOutboxFolder(bool hide);
47 [[nodiscard]] bool hideOutboxFolder() const;
48
49 void addContentMimeTypeInclusionFilter(const QString &mimeTypes);
50
51 void updatePalette();
52 void readConfig();
53
54 void setWarningThreshold(qreal threshold);
55
56protected:
57 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
58
59private:
60 class FolderTreeWidgetProxyModelPrivate;
61 std::unique_ptr<FolderTreeWidgetProxyModelPrivate> const d;
62};
63}
The FolderTreeWidgetProxyModel class.
The filter dialog.
DisplayRole
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:50:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.