Mailcommon

rulewidgethandler.h
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 
3  SPDX-FileCopyrightText: 2004 Ingo Kloecker <[email protected]>
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 
14 class QWidget;
15 class QStackedWidget;
16 class QString;
17 class QObject;
18 
19 namespace MailCommon
20 {
21 /**
22  * @short An interface to filter/search rule widget handlers
23  */
25 {
26 public:
27  virtual ~RuleWidgetHandler() = default;
28 
29  Q_REQUIRED_RESULT virtual QWidget *createFunctionWidget(int number, QStackedWidget *functionStack, const QObject *receiver, bool isAkonadiSearch) const = 0;
30  Q_REQUIRED_RESULT virtual QWidget *createValueWidget(int number, QStackedWidget *valueStack, const QObject *receiver) const = 0;
31  Q_REQUIRED_RESULT virtual MailCommon::SearchRule::Function function(const QByteArray &field, const QStackedWidget *functionStack) const = 0;
32  Q_REQUIRED_RESULT virtual QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const = 0;
33  Q_REQUIRED_RESULT virtual QString prettyValue(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const = 0;
34  Q_REQUIRED_RESULT virtual bool handlesField(const QByteArray &field) const = 0;
35  virtual void reset(QStackedWidget *functionStack, QStackedWidget *valueStack) const = 0;
36  Q_REQUIRED_RESULT virtual bool
37  setRule(QStackedWidget *functionStack, QStackedWidget *valueStack, const MailCommon::SearchRule::Ptr rule, bool isAkonadiSearch) const = 0;
38  Q_REQUIRED_RESULT virtual bool update(const QByteArray &field, QStackedWidget *functionStack, QStackedWidget *valueStack) const = 0;
39 };
40 }
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
An interface to filter/search rule widget handlers.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Oct 1 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.