summaryrefslogtreecommitdiffstats
path: root/knode/knarticlefilter.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /knode/knarticlefilter.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knarticlefilter.h')
-rw-r--r--knode/knarticlefilter.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/knode/knarticlefilter.h b/knode/knarticlefilter.h
new file mode 100644
index 000000000..6d544342d
--- /dev/null
+++ b/knode/knarticlefilter.h
@@ -0,0 +1,80 @@
+/*
+ knarticlefilter.h
+
+ KNode, the KDE newsreader
+ Copyright (c) 1999-2001 the KNode authors.
+ See file AUTHORS for details
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
+*/
+
+#ifndef KNARTICLEFILTER_H
+#define KNARTICLEFILTER_H
+
+#include "knstatusfilter.h"
+#include "knrangefilter.h"
+#include "knstringfilter.h"
+
+class KNRemoteArticle;
+class KNLocalArticle;
+class KNGroup;
+class KNFolder;
+
+
+class KNArticleFilter {
+
+ friend class KNFilterManager;
+ friend class KNFilterDialog;
+ friend class KNSearchDialog;
+
+ public:
+ KNArticleFilter(int id=-1);
+ KNArticleFilter(const KNArticleFilter& org); // constructs a copy of org
+ ~KNArticleFilter();
+
+ bool loadInfo();
+ void load();
+ void save();
+
+ void doFilter(KNGroup *g);
+ void doFilter(KNFolder *f);
+ int count()const { return c_ount; }
+ int id()const { return i_d; }
+ int applyOn() { return static_cast<int>(apon); }
+ const QString& name() { return n_ame; }
+ QString translatedName(); // *tries* to translate the name
+ bool isEnabled()const { return e_nabled; }
+ bool loaded()const { return l_oaded; }
+ bool isSearchFilter()const { return s_earchFilter; }
+
+ void setId(int i) { i_d=i; }
+ void setApplyOn(int i) { apon=(ApOn)i; }
+ void setLoaded(bool l) { l_oaded=l; }
+ void setName(const QString &s) { n_ame=s; }
+ void setTranslatedName(const QString &s); // *tries* to retranslate the name to english
+ void setEnabled(bool l) { e_nabled=l; }
+ void setSearchFilter(bool b) { s_earchFilter = b; }
+
+ protected:
+
+ enum ApOn { articles=0 , threads=1 };
+ bool applyFilter(KNRemoteArticle *a);
+ bool applyFilter(KNLocalArticle *a);
+
+ QString n_ame;
+ int i_d, c_ount;
+ bool l_oaded, e_nabled, translateName, s_earchFilter;
+ ApOn apon;
+
+ KNStatusFilter status;
+ KNRangeFilter score, age, lines;
+ KNStringFilter subject, from, messageId, references;
+};
+
+#endif