00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _PLUGINFACTORY_H
00024 #define _PLUGINFACTORY_H
00025
00026 #include <qstring.h>
00027
00028 #include <qwidget.h>
00029 #include <qmap.h>
00030 #include <qptrlist.h>
00031
00032 #include <kservice.h>
00033
00034 class QVSourcePlugin;
00035 class QVMixerPlugin;
00036 class QVOSDPlugin;
00037 class QVMiscPlugin;
00038 class ChannelIOFormat;
00039 class PluginDescPrivate;
00040
00041
00042
00043
00044 class PluginDesc
00045 {
00046 public:
00047
00048 typedef enum { UNKNOWN, VIDEO, CHANNEL, MIXER, OSD, MISC, IMAGEFILTER } PluginType;
00049 PluginDesc();
00050 PluginDesc(const PluginDesc& copy);
00051
00052 int id;
00053 QString name;
00054 QString author;
00055 QString comment;
00056 QString icon;
00057 QString lib;
00058 QString factory;
00059 KService::Ptr service;
00060 PluginType type;
00061 bool configurable;
00062 bool enabled;
00063
00064 friend int operator<(const PluginDesc& l, const PluginDesc& r);
00065 friend int operator>(const PluginDesc& l, const PluginDesc& r);
00066 friend int operator==(const PluginDesc& l, const PluginDesc& r);
00067 friend int operator!=(const PluginDesc& l, const PluginDesc& r);
00068
00069 private:
00070 PluginDescPrivate *d;
00071 };
00072
00073
00074 class KConfig;
00075
00079 class PluginFactory
00080 {
00081 public:
00082 QPtrList<PluginDesc>& videoPlugins();
00083
00084 QVSourcePlugin* getVideoPlugin(const PluginDesc *plugin, QWidget *w);
00085
00086 QPtrList<PluginDesc>& channelPlugins();
00087 ChannelIOFormat* getChannelPlugin(const PluginDesc *plugin);
00088
00089 QPtrList<PluginDesc>& mixerPlugins();
00090 QVMixerPlugin* getMixerPlugin(const PluginDesc *plugin);
00091
00092 QPtrList<PluginDesc>& miscPlugins();
00093 QVMiscPlugin* getMiscPlugin(const PluginDesc *plugin, QWidget *w);
00094
00095 QPtrList<PluginDesc>& osdPlugins();
00096
00097 QVOSDPlugin* getOSDPlugin(const PluginDesc *plugin, QWidget *w);
00098
00099
00100
00101 virtual void scanForPlugins();
00102
00103 protected:
00104 friend class QtVision;
00105 PluginFactory(QtVision *qtv);
00106 virtual ~PluginFactory();
00107
00108 void doScan(KService::List& plugs, QPtrList<PluginDesc>& list, PluginDesc::PluginType type);
00109
00110 private:
00111 static int _upid;
00112
00113 QPtrList<PluginDesc> _videoPlugins;
00114 QPtrList<PluginDesc> _mixerPlugins;
00115 QPtrList<PluginDesc> _osdPlugins;
00116 QPtrList<PluginDesc> _channelPlugins;
00117 QPtrList<PluginDesc> _miscPlugins;
00118
00119 KConfig *_cfg;
00120 QtVision *_qtv;
00121 };
00122
00123
00124
00125 #endif
00126