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

knode

knrangefilter.h

Go to the documentation of this file.
00001 /*
00002     KNode, the KDE newsreader
00003     Copyright (c) 1999-2006 the KNode authors.
00004     See file AUTHORS for details
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010     You should have received a copy of the GNU General Public License
00011     along with this program; if not, write to the Free Software Foundation,
00012     Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
00013 */
00014 
00015 #ifndef KNODE_KNRANGEFILTER_H
00016 #define KNODE_KNRANGEFILTER_H
00017 
00018 #include <QGroupBox>
00019 
00020 class QLabel;
00021 class KIntSpinBox;
00022 class QComboBox;
00023 class QCheckBox;
00024 
00025 class KConfig;
00026 
00027 namespace KNode {
00028 
00030 class RangeFilter
00031 {
00032   friend class RangeFilterWidget;
00033 
00034   public:
00035     RangeFilter()   { op1=eq; op2=dis; val1=0; val2=0; enabled=false; }
00036     ~RangeFilter()  {}
00037 
00038     RangeFilter& operator=( const RangeFilter &nr )
00039       { val1=nr.val1; val2=nr.val2;
00040         op1=nr.op1; op2=nr.op2;
00041         enabled=nr.enabled;
00042         return (*this); }
00043 
00044     void load(const KConfigGroup &conf);
00045     void save(KConfigGroup &conf);
00046 
00047     bool doFilter(int a);
00048 
00049   protected:
00050     enum Op { gt=0, gtoeq=1, eq=2, ltoeq=3, lt=4, dis=5 };
00051     bool matchesOp(int v1, Op o, int v2);
00052 
00053     int val1, val2;
00054     Op op1, op2;
00055     bool enabled;
00056 
00057 };
00058 
00059 
00060 //==================================================================================
00061 
00062 
00064 class RangeFilterWidget : public QGroupBox
00065 {
00066   Q_OBJECT
00067 
00068   public:
00076     RangeFilterWidget( const QString& value, int min, int max, QWidget* parent,
00077                        const QString &unit = QString() );
00078     ~RangeFilterWidget();
00079 
00080     RangeFilter filter();
00081     void setFilter( RangeFilter &f );
00082     void clear();
00083 
00084   protected:
00085     QCheckBox *enabled;
00086     QLabel *des;
00087     KIntSpinBox *val1, *val2;
00088     QComboBox *op1, *op2;
00089 
00090   protected slots:
00091     void slotEnabled(bool e);
00092     void slotOp1Changed(int id);
00093     void slotOp2Changed(int id);
00094 
00095 };
00096 
00097 }
00098 
00099 #endif // KNODE_KNRANGEFILTER_H

knode

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal