• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • search
rulewidgethandlermanager.h
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 
3  Copyright (c) 2004 Ingo Kloecker <kloecker@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19  In addition, as a special exception, the copyright holders give
20  permission to link the code of this program with any edition of
21  the Qt library by Trolltech AS, Norway (or with modified versions
22  of Qt that use the same license as Qt), and distribute linked
23  combinations including the two. You must obey the GNU General
24  Public License in all respects for all of the code used other than
25  Qt. If you modify this file, you may extend this exception to
26  your version of the file, but you are not obligated to do so. If
27  you do not wish to do so, delete this exception statement from
28  your version.
29 */
30 
31 #ifndef MAILCOMMON_RULEWIDGETHANDLERMANAGER_H
32 #define MAILCOMMON_RULEWIDGETHANDLERMANAGER_H
33 
34 #include "search/searchpattern.h"
35 
36 #include <QByteArray>
37 #include <QVector>
38 
39 class QObject;
40 class QString;
41 class QStackedWidget;
42 
43 namespace MailCommon {
44 
45 class RuleWidgetHandler;
46 
50 class RuleWidgetHandlerManager
51 {
52  static RuleWidgetHandlerManager * self;
53 
54  RuleWidgetHandlerManager();
55 
56 public:
57  ~RuleWidgetHandlerManager();
58 
59  static RuleWidgetHandlerManager *instance()
60  {
61  if ( !self ) {
62  self = new RuleWidgetHandlerManager();
63  }
64  return self;
65  }
66 
67  void setIsNepomukSearch(bool isNepomukSearch);
68 
69  void registerHandler( const RuleWidgetHandler *handler );
70  void unregisterHandler( const RuleWidgetHandler *handler );
71 
72  void createWidgets(QStackedWidget *functionStack,
73  QStackedWidget *valueStack,
74  const QObject *receiver) const;
75 
76  MailCommon::SearchRule::Function function( const QByteArray & field,
77  const QStackedWidget *functionStack ) const;
78 
79  QString value( const QByteArray &field,
80  const QStackedWidget *functionStack,
81  const QStackedWidget *valueStack ) const;
82 
83  QString prettyValue( const QByteArray & field,
84  const QStackedWidget *functionStack,
85  const QStackedWidget *valueStack ) const;
86 
87  bool handlesField( const QByteArray & field,
88  const QStackedWidget *functionStack,
89  const QStackedWidget *valueStack ) const;
90 
91  void reset( QStackedWidget *functionStack,
92  QStackedWidget *valueStack ) const;
93 
94  void setRule(QStackedWidget *functionStack,
95  QStackedWidget *valueStack,
96  const MailCommon::SearchRule::Ptr rule ) const;
97 
98  void update( const QByteArray & field,
99  QStackedWidget *functionStack,
100  QStackedWidget *valueStack ) const;
101 
102 private:
103  typedef QVector<const RuleWidgetHandler*>::const_iterator const_iterator;
104  typedef QVector<const RuleWidgetHandler*>::iterator iterator;
105 
106  QVector<const RuleWidgetHandler*> mHandlers;
107  bool mIsNepomukSearch;
108 };
109 
110 } // namespace MailCommon
111 
112 #endif
MailCommon::RuleWidgetHandlerManager::instance
static RuleWidgetHandlerManager * instance()
Definition: rulewidgethandlermanager.h:59
MailCommon::RuleWidgetHandlerManager::createWidgets
void createWidgets(QStackedWidget *functionStack, QStackedWidget *valueStack, const QObject *receiver) const
Definition: rulewidgethandlermanager.cpp:123
MailCommon::RuleWidgetHandlerManager::unregisterHandler
void unregisterHandler(const RuleWidgetHandler *handler)
Definition: rulewidgethandlermanager.cpp:96
MailCommon::RuleWidgetHandlerManager::~RuleWidgetHandlerManager
~RuleWidgetHandlerManager()
Definition: rulewidgethandlermanager.cpp:76
MailCommon::RuleWidgetHandlerManager::setRule
void setRule(QStackedWidget *functionStack, QStackedWidget *valueStack, const MailCommon::SearchRule::Ptr rule) const
Definition: rulewidgethandlermanager.cpp:208
MailCommon::RuleWidgetHandlerManager::setIsNepomukSearch
void setIsNepomukSearch(bool isNepomukSearch)
Definition: rulewidgethandlermanager.cpp:82
MailCommon::SearchRule::Ptr
boost::shared_ptr< SearchRule > Ptr
Defines a pointer to a search rule.
Definition: searchpattern.h:69
MailCommon::RuleWidgetHandlerManager
Singleton to manage the list of RuleWidgetHandlers.
Definition: rulewidgethandlermanager.h:50
QObject
MailCommon::RuleWidgetHandlerManager::value
QString value(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const
Definition: rulewidgethandlermanager.cpp:170
MailCommon::SearchRule::Function
Function
Describes operators for comparison of field and contents.
Definition: searchpattern.h:80
MailCommon::RuleWidgetHandlerManager::reset
void reset(QStackedWidget *functionStack, QStackedWidget *valueStack) const
Definition: rulewidgethandlermanager.cpp:198
searchpattern.h
MailCommon::RuleWidgetHandlerManager::prettyValue
QString prettyValue(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const
Definition: rulewidgethandlermanager.cpp:184
MailCommon::RuleWidgetHandlerManager::update
void update(const QByteArray &field, QStackedWidget *functionStack, QStackedWidget *valueStack) const
Definition: rulewidgethandlermanager.cpp:222
MailCommon::RuleWidgetHandler
An interface to filter/search rule widget handlers.
Definition: rulewidgethandler.h:49
MailCommon::RuleWidgetHandlerManager::handlesField
bool handlesField(const QByteArray &field, const QStackedWidget *functionStack, const QStackedWidget *valueStack) const
MailCommon::RuleWidgetHandlerManager::registerHandler
void registerHandler(const RuleWidgetHandler *handler)
Definition: rulewidgethandlermanager.cpp:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal