french -> French
[kdepim.git] / knode / knarticlefilter.h
blob5238d44daaf8f5850fd36e1f01df8536a68826ad
1 /*
2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
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
15 #ifndef KNARTICLEFILTER_H
16 #define KNARTICLEFILTER_H
18 #include "kngroup.h"
19 #include "knfolder.h"
20 #include "knstatusfilter.h"
21 #include "knrangefilter.h"
22 #include "knstringfilter.h"
24 class KNRemoteArticle;
25 class KNLocalArticle;
27 namespace KNode {
28 class SearchDialog;
32 /** Article filter. */
33 class KNArticleFilter {
35 friend class KNFilterManager;
36 friend class KNFilterDialog;
37 friend class KNode::SearchDialog;
39 public:
40 explicit KNArticleFilter(int id=-1);
41 /// Copy constructor
42 KNArticleFilter(const KNArticleFilter& org);
43 ~KNArticleFilter();
45 bool loadInfo();
46 void load();
47 void save();
49 void doFilter( KNGroup::Ptr g );
50 void doFilter( KNFolder::Ptr f );
51 int count()const { return c_ount; }
52 int id()const { return i_d; }
53 int applyOn() { return static_cast<int>(apon); }
54 const QString& name() { return n_ame; }
55 /// *tries* to translate the name
56 QString translatedName();
57 bool isEnabled()const { return e_nabled; }
58 bool loaded()const { return l_oaded; }
59 bool isSearchFilter()const { return s_earchFilter; }
61 void setId(int i) { i_d=i; }
62 void setApplyOn(int i) { apon=(ApOn)i; }
63 void setLoaded(bool l) { l_oaded=l; }
64 void setName(const QString &s) { n_ame=s; }
65 /// *tries* to retranslate the name to english
66 void setTranslatedName(const QString &s);
67 void setEnabled(bool l) { e_nabled=l; }
68 void setSearchFilter(bool b) { s_earchFilter = b; }
70 protected:
72 enum ApOn { articles=0 , threads=1 };
73 bool applyFilter( KNRemoteArticle::Ptr a );
74 bool applyFilter( KNLocalArticle::Ptr a );
76 QString n_ame;
77 int i_d, c_ount;
78 bool l_oaded, e_nabled, translateName, s_earchFilter;
79 ApOn apon;
81 KNode::StatusFilter status;
82 KNode::RangeFilter score, age, lines;
83 KNode::StringFilter subject, from, messageId, references;
86 #endif