00001 #ifndef SERVICEFILTER_H
00002 #define SERVICEFILTER_H
00003
00004 #include <QObject>
00005 #include <QVariant>
00006 #include <QSet>
00007
00008 #include "servicemgr.h"
00009 #include "widgets/filter/filterpanel.h"
00010
00011 class ServiceMgr;
00012 class ServiceFilterWidget;
00013 class DriverInfo;
00014 class QWidget;
00015 class QToolBar;
00016 class QActionGroup;
00017
00018 class ServiceFilter : public QObject
00019 {
00020 Q_OBJECT
00021 ServiceMgr* mServiceManager;
00022
00023 mutable QSet<QString> mCacheServiceNames;
00024 bool isServiceActive(const DriverInfo* driver) const;
00025 void fillPanel();
00026
00027 public:
00028 explicit ServiceFilter(ServiceMgr* mgr, QObject *parent = 0);
00029 QWidget* createWidget();
00030 void hideWidget(bool hide);
00031
00032 signals:
00033 void serviceSelected(DriverInfo* driverInfo, int index = -1);
00034 void itemAdded(const QIcon& icon, DriverInfo* driver, bool checked = 0);
00035 void itemAdded(const QString& string, DriverInfo* driver, bool checked = 0);
00036 void reset();
00037
00038 public slots:
00039 void updateAccounts(QString str, AccountList accountList);
00040
00041 private:
00042 FilterPanel *filterPanel;
00043 };
00044
00045 #endif // SERVICEFILTER_H