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

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
knrangefilter.h
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2006 the KNode authors.
4  See file AUTHORS for details
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 #ifndef KNODE_KNRANGEFILTER_H
16 #define KNODE_KNRANGEFILTER_H
17 
18 #include <QGroupBox>
19 
20 class QLabel;
21 class KIntSpinBox;
22 class QComboBox;
23 class QCheckBox;
24 
25 class KConfig;
26 
27 namespace KNode {
28 
30 class RangeFilter
31 {
32  friend class RangeFilterWidget;
33 
34  public:
35  RangeFilter() { op1=eq; op2=dis; val1=0; val2=0; enabled=false; }
36  ~RangeFilter() {}
37 
38  RangeFilter& operator=( const RangeFilter &nr )
39  { val1=nr.val1; val2=nr.val2;
40  op1=nr.op1; op2=nr.op2;
41  enabled=nr.enabled;
42  return (*this); }
43 
44  void load(const KConfigGroup &conf);
45  void save(KConfigGroup &conf);
46 
47  bool doFilter(int a);
48 
49  protected:
50  enum Op { gt=0, gtoeq=1, eq=2, ltoeq=3, lt=4, dis=5 };
51  bool matchesOp(int v1, Op o, int v2);
52 
53  int val1, val2;
54  Op op1, op2;
55  bool enabled;
56 
57 };
58 
59 
60 //==================================================================================
61 
62 
64 class RangeFilterWidget : public QGroupBox
65 {
66  Q_OBJECT
67 
68  public:
76  RangeFilterWidget( const QString& value, int min, int max, QWidget* parent,
77  const QString &unit = QString() );
78  ~RangeFilterWidget();
79 
80  RangeFilter filter();
81  void setFilter( RangeFilter &f );
82  void clear();
83 
84  protected:
85  QCheckBox *enabled;
86  QLabel *des;
87  KIntSpinBox *val1, *val2;
88  QComboBox *op1, *op2;
89 
90  protected slots:
91  void slotEnabled(bool e);
92  void slotOp1Changed(int id);
93  void slotOp2Changed(int id);
94 
95 };
96 
97 }
98 
99 #endif // KNODE_KNRANGEFILTER_H
KNode::RangeFilterWidget::clear
void clear()
Definition: knrangefilter.cpp:187
KNode::RangeFilter::ltoeq
Definition: knrangefilter.h:50
KNode::RangeFilter::load
void load(const KConfigGroup &conf)
Definition: knrangefilter.cpp:73
KNode::RangeFilter::val2
int val2
Definition: knrangefilter.h:53
KNode::RangeFilter::enabled
bool enabled
Definition: knrangefilter.h:55
KNode::RangeFilter::eq
Definition: knrangefilter.h:50
KNode::RangeFilter
Filter for interger ranges.
Definition: knrangefilter.h:30
KNode::RangeFilter::op2
Op op2
Definition: knrangefilter.h:54
QWidget
KNode::RangeFilter::dis
Definition: knrangefilter.h:50
KNode::RangeFilter::op1
Op op1
Definition: knrangefilter.h:54
KNode::RangeFilter::operator=
RangeFilter & operator=(const RangeFilter &nr)
Definition: knrangefilter.h:38
KNode::RangeFilter::gtoeq
Definition: knrangefilter.h:50
KNode::RangeFilterWidget::filter
RangeFilter filter()
Definition: knrangefilter.cpp:148
KNode::RangeFilter::doFilter
bool doFilter(int a)
Definition: knrangefilter.cpp:28
KNode::RangeFilterWidget::op1
QComboBox * op1
Definition: knrangefilter.h:88
KNode::RangeFilterWidget::val1
KIntSpinBox * val1
Definition: knrangefilter.h:87
KNode::RangeFilterWidget::RangeFilterWidget
RangeFilterWidget(const QString &value, int min, int max, QWidget *parent, const QString &unit=QString())
Creates a new RangeFilter configuration widet.
Definition: knrangefilter.cpp:98
KNode::RangeFilterWidget::setFilter
void setFilter(RangeFilter &f)
Definition: knrangefilter.cpp:169
KNode::RangeFilter::val1
int val1
Definition: knrangefilter.h:53
KNode::RangeFilterWidget::slotOp1Changed
void slotOp1Changed(int id)
Definition: knrangefilter.cpp:196
QComboBox
KNode::RangeFilter::Op
Op
Definition: knrangefilter.h:50
KNode::RangeFilter::save
void save(KConfigGroup &conf)
Definition: knrangefilter.cpp:84
KNode::RangeFilterWidget::slotEnabled
void slotEnabled(bool e)
Definition: knrangefilter.cpp:213
QGroupBox
KNode::RangeFilter::RangeFilter
RangeFilter()
Definition: knrangefilter.h:35
KNode::RangeFilter::gt
Definition: knrangefilter.h:50
KNode::RangeFilterWidget::slotOp2Changed
void slotOp2Changed(int id)
Definition: knrangefilter.cpp:206
KNode::RangeFilterWidget::enabled
QCheckBox * enabled
Definition: knrangefilter.h:85
KNode::RangeFilter::~RangeFilter
~RangeFilter()
Definition: knrangefilter.h:36
KNode::RangeFilterWidget::~RangeFilterWidget
~RangeFilterWidget()
Definition: knrangefilter.cpp:142
QLabel
KNode::RangeFilterWidget::des
QLabel * des
Definition: knrangefilter.h:86
KNode::RangeFilterWidget::val2
KIntSpinBox * val2
Definition: knrangefilter.h:87
KNode::RangeFilter::lt
Definition: knrangefilter.h:50
KNode::RangeFilterWidget::op2
QComboBox * op2
Definition: knrangefilter.h:88
KNode::RangeFilterWidget
Configuration widget for KNode::RangeFilter.
Definition: knrangefilter.h:64
KNode::RangeFilter::matchesOp
bool matchesOp(int v1, Op o, int v2)
Definition: knrangefilter.cpp:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • 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