Mailcommon

rulewidgethandler.h
1/* -*- mode: C++; c-file-style: "gnu" -*-
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
14class QWidget;
15class QStackedWidget;
16class QString;
17class QObject;
18
19namespace MailCommon
20{
21/**
22 * @short An interface to filter/search rule widget handlers
23 */
25{
26public:
27 virtual ~RuleWidgetHandler() = default;
28
29 [[nodiscard]] virtual QWidget *createFunctionWidget(int number, QStackedWidget *functionStack, const QObject *receiver, bool isAkonadiSearch) const = 0;
30 [[nodiscard]] virtual QWidget *createValueWidget(int number, QStackedWidget *valueStack, const QObject *receiver) const = 0;
31 [[nodiscard]] virtual MailCommon::SearchRule::Function function(const QByteArray &field, const QStackedWidget *functionStack) const = 0;
32 [[nodiscard]] virtual QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const = 0;
33 [[nodiscard]] virtual QString prettyValue(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const = 0;
34 [[nodiscard]] virtual bool handlesField(const QByteArray &field) const = 0;
35 virtual void reset(QStackedWidget *functionStack, QStackedWidget *valueStack) const = 0;
36 [[nodiscard]] virtual bool
37 setRule(QStackedWidget *functionStack, QStackedWidget *valueStack, const MailCommon::SearchRule::Ptr rule, bool isAkonadiSearch) const = 0;
38 [[nodiscard]] virtual bool update(const QByteArray &field, QStackedWidget *functionStack, QStackedWidget *valueStack) const = 0;
39};
40}
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 Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.