Home · All Classes · All Namespaces · Modules · Functions · Files

filter.h

00001 
00023 #ifndef _TelepathyQt4_filter_h_HEADER_GUARD_
00024 #define _TelepathyQt4_filter_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/SharedPtr>
00031 #include <TelepathyQt4/Types>
00032 
00033 namespace Tp
00034 {
00035 
00036 /*
00037  * TODO filter:
00038  *
00039  * Make filters not always be AND - as in, if you have multiple filters, you might want to do both
00040  * if ANY of them match or if (A AND B match) OR (C MATCHES) etc - so provide generic "combinator
00041  * filters"
00042  */
00043 template <class T>
00044 class Filter : public RefCounted
00045 {
00046     Q_DISABLE_COPY(Filter)
00047 
00048 public:
00049     virtual ~Filter() {}
00050 
00051     virtual bool isValid() const { return false; }
00052 
00053     virtual bool matches(const SharedPtr<T> &t) const
00054     {
00055         Q_UNUSED(t);
00056 
00057         return false;
00058     }
00059 
00060 protected:
00061     Filter() {}
00062 
00063 private:
00064     struct Private;
00065     Private *mPriv; // Just a placeholder really
00066 };
00067 
00068 } // Tp
00069 
00070 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.5.12