Mailcommon

rulewidgethandlermanager.h
1/*
2
3 SPDX-FileCopyrightText: 2004 Ingo Kloecker <kloecker@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "search/searchpattern.h"
11
12#include <QByteArray>
13#include <QList>
14
15class QObject;
16class QString;
17class QStackedWidget;
18
19namespace MailCommon
20{
21class RuleWidgetHandler;
22
23/**
24 * @short Singleton to manage the list of RuleWidgetHandlers
25 */
27{
28 static RuleWidgetHandlerManager *self;
29
31
32public:
34
35 static RuleWidgetHandlerManager *instance()
36 {
37 if (!self) {
38 self = new RuleWidgetHandlerManager();
39 }
40 return self;
41 }
42
43 void setIsAkonadiSearch(bool isBalooSearch);
44
45 void registerHandler(const RuleWidgetHandler *handler);
46 void unregisterHandler(const RuleWidgetHandler *handler);
47
48 void createWidgets(QStackedWidget *functionStack, QStackedWidget *valueStack, const QObject *receiver) const;
49
50 MailCommon::SearchRule::Function function(const QByteArray &field, const QStackedWidget *functionStack) const;
51
52 [[nodiscard]] QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const;
53
54 [[nodiscard]] QString prettyValue(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const;
55
56 void reset(QStackedWidget *functionStack, QStackedWidget *valueStack) const;
57
58 void setRule(QStackedWidget *functionStack, QStackedWidget *valueStack, const MailCommon::SearchRule::Ptr rule) const;
59
60 void update(const QByteArray &field, QStackedWidget *functionStack, QStackedWidget *valueStack) const;
61
62private:
65
67 bool mIsBalooSearch = false;
68};
69} // namespace MailCommon
Singleton to manage the list of RuleWidgetHandlers.
An interface to filter/search rule widget handlers.
std::shared_ptr< SearchRule > Ptr
Defines a pointer to a search rule.
Definition searchrule.h:29
Function
Describes operators for comparison of field and contents.
Definition searchrule.h:40
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:58:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.