pluginloader.h

Go to the documentation of this file.
00001 /* ============================================================
00002  * File  : pluginloader.h
00003  * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
00004  * Date  : 2004-02-19
00005  * Description :
00006  *
00007  * Copyright 2004 by Renchi Raju
00008 
00009  * This program is free software; you can redistribute it
00010  * and/or modify it under the terms of the GNU Library General
00011  * Public License as published by the Free Software Foundation;
00012  * either version 2, or (at your option)
00013  * any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU Library General Public License for more details.
00019  *
00020  * ============================================================ */
00021 
00022 #ifndef KIPI_PLUGINLOADER_H
00023 #define KIPI_PLUGINLOADER_H
00024 
00025 #include "libkipi/interface.h"
00026 #include "libkipi/libkipi_export.h"
00027 #include <qwidget.h>
00028 #include <qscrollview.h>
00029 
00030 
00031 namespace KIPI
00032 {
00033     class Plugin;
00034     class Interface;
00035     class ConfigWidget;
00036 
00037     class LIBKIPI_EXPORT PluginLoader :public QObject
00038     {
00039         Q_OBJECT
00040     public:
00041         class LIBKIPI_EXPORT Info
00042         {
00043                 public:
00044             Info( const QString& name, const QString& comment, const QString& library, bool shouldLoad );
00045             ~Info();
00046             QString name() const;
00047             
00048                         QString comment() const;
00049             
00050                         QString library() const;
00051             
00052                         Plugin* plugin() const;
00053                         void setPlugin(Plugin*);
00054                         
00055             bool shouldLoad() const;
00056             void setShouldLoad(bool);
00057 
00058                 private:
00059                         struct Private;
00060                         Private* d;
00061         };
00062 
00063         PluginLoader( const QStringList& ignores, Interface* interface );
00064         virtual ~PluginLoader();
00065         void loadPlugins();
00066         static PluginLoader* instance();
00067         ConfigWidget* configWidget( QWidget* parent );
00068 
00069         typedef QValueList<Info*> PluginList;
00070 
00071         const PluginList& pluginList();
00072 
00073         void loadPlugin( Info* );
00074 
00075     signals:
00076         void plug( KIPI::PluginLoader::Info* );
00077         void unplug( KIPI::PluginLoader::Info* );
00078         void replug();
00079 
00080     private:
00081         friend class ConfigWidget;
00082         friend class PluginCheckBox;
00083 
00084                 struct Private;
00085                 Private* d;
00086     };
00087 
00088     class LIBKIPI_EXPORT ConfigWidget :public QScrollView
00089     {
00090         Q_OBJECT
00091     public:
00092         ConfigWidget( QWidget* parent );
00093                 ~ConfigWidget();
00094     public slots:
00095         void apply();
00096     private:
00097                 struct Private;
00098                 Private* d;
00099     };
00100 }
00101 
00102 #endif /* PLUGINLOADER_H */

Generated on Mon Nov 27 23:42:22 2006 for libKipi by  doxygen 1.5.0