18 #ifndef KDEPIM_KSCORING_H
19 #define KDEPIM_KSCORING_H
30 #include <QStringList>
31 #include <QTextStream>
65 virtual void displayMessage(
const QString & );
68 virtual QString
from()
const = 0;
69 virtual QString
subject()
const = 0;
70 virtual QString getHeaderByType(
const QString & )
const = 0;
81 virtual QString toString()
const = 0;
84 virtual int getType()
const = 0;
87 static ActionBase *factory(
int type,
const QString &value );
88 static QStringList userNames();
89 static QString userName(
int type );
90 static int getTypeForName(
const QString &name );
91 static int getTypeForUserName(
const QString &name );
107 virtual QString toString()
const;
110 virtual void setValue(
const QString &s ) { color.setNamedColor(s); }
112 QColor
value()
const {
return color; }
126 virtual QString toString()
const;
127 virtual int getType()
const {
return SETSCORE; }
129 virtual void setValue(
const QString &s ) { val = s.toShort(); }
144 virtual QString toString()
const;
145 virtual int getType()
const {
return NOTIFY; }
147 virtual void setValue(
const QString &s ) { note = s; }
160 virtual QString toString()
const;
161 virtual int getType()
const {
return MARKASREAD; }
172 QString collection()
const;
173 void displayCollection(
QWidget *p=0 )
const;
175 struct article_info {
180 typedef Q3Dict<article_list> note_list;
181 note_list notifyList;
198 KScoringExpression(
const QString &,
const QString &,
const QString &,
const QString & );
202 QString getTypeString()
const;
203 static QString getTypeString(
int );
205 QString toString()
const;
206 void write( QTextStream & )
const;
212 static QStringList conditionNames();
213 static QStringList headerNames();
214 static int getConditionForName(
const QString & );
215 static QString getNameForCondition(
int );
247 QString getLinkModeName()
const;
248 QString getExpireDateString()
const;
251 bool isExpired()
const;
254 void cleanExpressions();
257 bool matchGroup(
const QString &group )
const ;
262 void setLinkMode(
const QString &link );
264 void setExpire(
const QString &exp );
266 void addGroup(
const QString &group ) { groups.append(group); }
267 void addAction(
int,
const QString & );
270 void updateXML( QDomElement &e, QDomDocument &d );
271 QString toString()
const;
274 void write( QTextStream & )
const;
278 void setName(
const QString &n ) { name = n; }
285 ScoreExprList expressions;
300 void push( Q3PtrList<KScoringRule>& );
303 void pop( Q3PtrList<KScoringRule>& );
305 void top( Q3PtrList<KScoringRule>& );
310 Q3PtrStack< Q3PtrList<KScoringRule> > stack;
326 virtual QStringList getGroups()
const = 0;
330 virtual QStringList getDefaultHeaders()
const;
357 void setGroup(
const QString &g );
359 bool hasRulesForCurrentGroup();
360 QString findUniqueName()
const;
368 QStringList getRuleNames();
371 QString toString()
const;
373 bool setCacheValid(
bool v );
375 void initCache(
const QString &group );
385 virtual bool hasFeature(
int );
389 void changedRuleName(
const QString &oldName,
const QString &newName );
390 void finishedEditing();
396 QDomDocument createXMLfromInternal();
397 void createInternalFromXML(QDomNode);
400 ScoringRuleList allRules;
408 ScoringRuleList ruleList;
426 void slotShowAgainToggled(
bool );
434 typedef QMap<QString,bool> NotesMap;
435 static NotesMap dict;
ActionList getActions() const
virtual QString getValueString() const
virtual ~ActionMarkAsRead()
void setExpireDate(const QDate &d)
virtual int getType() const
virtual bool canScores() const
virtual void setValue(const QString &s)
virtual void setValue(const QString &s)
ScoreExprList getExpressions() const
virtual void setValue(const QString &)
QString getExpression() const
Q3PtrList< KScoringRule > ScoringRuleList
virtual QString getValueString() const
QString getHeader() const
this helper class implements a stack for lists of lists of rules.
Condition getCondition() const
LinkMode getLinkMode() const
virtual bool canColors() const
virtual void markAsRead()
Base class for other Action classes.
virtual void addScore(short)
Q3PtrList< KScoringExpression > ScoreExprList
virtual int getType() const
virtual void changeColor(const QColor &)
void setLinkMode(LinkMode m)
void setGroups(const QStringList &l)
QStringList getGroups() const
virtual bool canNotes() const
QDate getExpireDate() const
The following classes ScorableArticle, ScorableGroup define the interface for the scoring...
virtual bool canMarkAsRead() const
virtual int getType() const
ScoringRuleList getAllRules() const
virtual int getType() const
void addGroup(const QString &group)
void setName(const QString &n)
assert that the name is unique
virtual QString getValueString() const
virtual void setValue(const QString &s)
virtual QString getValueString() const
void setValue(const QColor &c)
Q3PtrList< ActionBase > ActionList