Mailcommon

numericrulewidgethandler.h
1 /*
2  SPDX-FileCopyrightText: 2013-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include "interfaces/rulewidgethandler.h"
9 
10 namespace MailCommon
11 {
12 class NumericRuleWidgetHandler : public MailCommon::RuleWidgetHandler
13 {
14 public:
15  NumericRuleWidgetHandler()
16  : MailCommon::RuleWidgetHandler()
17  {
18  }
19 
20  ~NumericRuleWidgetHandler() override = default;
21 
22  QWidget *createFunctionWidget(int number, QStackedWidget *functionStack, const QObject *receiver, bool isBalooSearch) const override;
23 
24  QWidget *createValueWidget(int number, QStackedWidget *valueStack, const QObject *receiver) const override;
25 
26  SearchRule::Function function(const QByteArray &field, const QStackedWidget *functionStack) const override;
27 
28  QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const override;
29 
30  QString prettyValue(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const override;
31 
32  bool handlesField(const QByteArray &field) const override;
33 
34  void reset(QStackedWidget *functionStack, QStackedWidget *valueStack) const override;
35 
36  bool setRule(QStackedWidget *functionStack, QStackedWidget *valueStack, const SearchRule::Ptr rule, bool isBalooSearch) const override;
37 
38  bool update(const QByteArray &field, QStackedWidget *functionStack, QStackedWidget *valueStack) const override;
39 
40 private:
41  SearchRule::Function currentFunction(const QStackedWidget *functionStack) const;
42  QString currentValue(const QStackedWidget *valueStack) const;
43 };
44 }
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.
void update(Part *part, const QByteArray &data, qint64 dataSize)
KGuiItem reset()
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.