Mailcommon

rulewidgethandlermanager.h
1 /*
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 #include <QVector>
14 
15 class QObject;
16 class QString;
17 class QStackedWidget;
18 
19 namespace MailCommon
20 {
21 class RuleWidgetHandler;
22 
23 /**
24  * @short Singleton to manage the list of RuleWidgetHandlers
25  */
27 {
28  static RuleWidgetHandlerManager *self;
29 
31 
32 public:
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  QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const;
53 
54  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 
62 private:
65 
67  bool mIsBalooSearch = false;
68 };
69 } // namespace MailCommon
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.
Singleton to manage the list of RuleWidgetHandlers.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Sep 24 2022 03:58:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.