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>
14namespace Akonadi
15{
16class AccountActivitiesAbstract;
17}
18namespace MailCommon
19{
20/**
21 * @brief The FolderTreeWidgetProxyModel class
22 * @author Laurent Montel <montel@kde.org>
23 */
25{
26 Q_OBJECT
27
28public:
29 enum FolderTreeWidgetProxyModelOption {
30 None = 0,
31 HideVirtualFolder = 1,
32 HideSpecificFolder = 2,
33 HideOutboxFolder = 4,
34 };
35 Q_DECLARE_FLAGS(FolderTreeWidgetProxyModelOptions, FolderTreeWidgetProxyModelOption)
36
37 explicit FolderTreeWidgetProxyModel(QObject *parent = nullptr, FolderTreeWidgetProxyModelOptions = FolderTreeWidgetProxyModel::None);
38
40
41 [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
42
43 [[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
44
45 void setEnabledCheck(bool enable);
46 [[nodiscard]] bool enabledCheck() const;
47
48 void setHideVirtualFolder(bool exclude);
49 [[nodiscard]] bool hideVirtualFolder() const;
50
51 void setHideSpecificFolder(bool hide);
52 [[nodiscard]] bool hideSpecificFolder() const;
53
54 void setHideOutboxFolder(bool hide);
55 [[nodiscard]] bool hideOutboxFolder() const;
56
57 void addContentMimeTypeInclusionFilter(const QString &mimeTypes);
58
59 void updatePalette();
60 void readConfig();
61
62 void setWarningThreshold(qreal threshold);
63
64 void setAccountActivities(Akonadi::AccountActivitiesAbstract *accountActivities);
65
66protected:
67 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
68
69private:
70 class FolderTreeWidgetProxyModelPrivate;
71 std::unique_ptr<FolderTreeWidgetProxyModelPrivate> const d;
72};
73}
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 Oct 4 2024 12:04:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.