Messagelib

filtersavedmanager.h
1 /*
2  SPDX-FileCopyrightText: 2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include <QObject>
9 class QMenu;
10 namespace MessageList
11 {
12 namespace Core
13 {
14 class Filter;
15 class FilterSavedManager : public QObject
16 {
17  Q_OBJECT
18 public:
19  struct FilterInfo {
20  QString filterName;
21  QString identifier;
22  QString iconName;
23  };
24  explicit FilterSavedManager(QObject *parent = nullptr);
25  ~FilterSavedManager() override;
26 
27  void saveFilter(MessageList::Core::Filter *filter, const QString &filtername, const QString &iconName);
28  void loadMenu(QMenu *menu);
29  Q_REQUIRED_RESULT QVector<FilterInfo> filterInfos() const;
30 
31  static FilterSavedManager *self();
32 
33  void removeFilter(const QString &identifier);
34  void updateFilter(const QString &identifier, const QString &newName, const QString &iconName = {});
35  Q_REQUIRED_RESULT Filter *loadFilter(const QString &identifier);
36  Q_REQUIRED_RESULT QStringList existingFilterNames() const;
37 
38 Q_SIGNALS:
39  void activateFilter(const QString &identifier);
40 };
41 }
42 }
43 Q_DECLARE_TYPEINFO(MessageList::Core::FilterSavedManager::FilterInfo, Q_MOVABLE_TYPE);
Q_OBJECTQ_OBJECT
This class is responsible of matching messages that should be displayed in the View.
Definition: filter.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:16:42 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.