summaryrefslogtreecommitdiffstats
path: root/akregator/src/articleinterceptor.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 /akregator/src/articleinterceptor.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 'akregator/src/articleinterceptor.h')
-rw-r--r--akregator/src/articleinterceptor.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/akregator/src/articleinterceptor.h b/akregator/src/articleinterceptor.h
new file mode 100644
index 000000000..ed3c550c0
--- /dev/null
+++ b/akregator/src/articleinterceptor.h
@@ -0,0 +1,46 @@
+#ifndef AKREGATOR_ARTICLEINTERCEPTOR_H
+#define AKREGATOR_ARTICLEINTERCEPTOR_H
+
+#include "akregator_export.h"
+
+template <class T> class QValueList;
+
+namespace Akregator {
+
+class Article;
+
+/** Interface for intercepting new articles which were just fetched before adding
+ * them to the archive. E.g. an article filter could implement this interface to
+ * get fetched articles and label them */
+
+class AKREGATOR_EXPORT ArticleInterceptor
+{
+ public:
+ /** processes an article. Note that the interceptor may modify the article */
+ virtual void processArticle(Article& article) = 0;
+
+};
+
+/** Singleton managing the interceptors */
+class AKREGATOR_EXPORT ArticleInterceptorManager
+{
+ public:
+
+ static ArticleInterceptorManager* self();
+
+ ArticleInterceptorManager();
+ virtual ~ArticleInterceptorManager();
+
+ void addInterceptor(ArticleInterceptor* interceptor);
+ void removeInterceptor(ArticleInterceptor* interceptor);
+ QValueList<ArticleInterceptor*> interceptors() const;
+
+ private:
+ static ArticleInterceptorManager* m_self;
+ class ArticleInterceptorManagerPrivate;
+ ArticleInterceptorManagerPrivate* d;
+};
+
+} //namespace Akregator
+
+#endif // AKREGATOR_ARTICLEINTERCEPTOR_H