Mailcommon

foldertreewidgetproxymodel.h
1 /*
2  SPDX-FileCopyrightText: 2009-2022 Laurent Montel <[email protected]>
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 
15 namespace MailCommon
16 {
17 /**
18  * @brief The FolderTreeWidgetProxyModel class
19  * @author Laurent Montel <[email protected]>
20  */
22 {
23  Q_OBJECT
24 
25 public:
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 
31  ~FolderTreeWidgetProxyModel() override;
32 
33  Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override;
34 
35  Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
36 
37  void setEnabledCheck(bool enable);
38  Q_REQUIRED_RESULT bool enabledCheck() const;
39 
40  void setHideVirtualFolder(bool exclude);
41  Q_REQUIRED_RESULT bool hideVirtualFolder() const;
42 
43  void setHideSpecificFolder(bool hide);
44  Q_REQUIRED_RESULT bool hideSpecificFolder() const;
45 
46  void setHideOutboxFolder(bool hide);
47  Q_REQUIRED_RESULT bool hideOutboxFolder() const;
48 
49  void addContentMimeTypeInclusionFilter(const QString &mimeTypes);
50 
51  void updatePalette();
52  void readConfig();
53 
54  void setWarningThreshold(qreal threshold);
55 
56 protected:
57  bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
58 
59 private:
60  class FolderTreeWidgetProxyModelPrivate;
61  std::unique_ptr<FolderTreeWidgetProxyModelPrivate> const d;
62 };
63 }
DisplayRole
typedef ItemFlags
The FolderTreeWidgetProxyModel class.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Sep 24 2022 03:58:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.