Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

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 bythe 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 <qwidget.h>
00027 #include <qscrollview.h>
00028 
00029 
00030 namespace KIPI
00031 {
00032     class Plugin;
00033     class Interface;
00034     class ConfigWidget;
00035 
00036     class PluginLoader :public QObject
00037     {
00038         Q_OBJECT
00039     public:
00040         class Info
00041         {
00042                 public:
00043             Info( const QString& name, const QString& comment, const QString& library, bool shouldLoad );
00044             ~Info();
00045             QString name() const;
00046             
00047                         QString comment() const;
00048             
00049                         QString library() const;
00050             
00051                         Plugin* plugin() const;
00052                         void setPlugin(Plugin*);
00053                         
00054             bool shouldLoad() const;
00055             void setShouldLoad(bool);
00056 
00057                 private:
00058                         struct Private;
00059                         Private* d;
00060         };
00061 
00062         PluginLoader( const QStringList& ignores, Interface* interface );
00063         virtual ~PluginLoader();
00064         void loadPlugins();
00065         static PluginLoader* instance();
00066         ConfigWidget* configWidget( QWidget* parent );
00067 
00068         typedef QValueList<Info*> PluginList;
00069 
00070         const PluginList& pluginList();
00071 
00072     signals:
00073         void plug( KIPI::PluginLoader::Info* );
00074         void unplug( KIPI::PluginLoader::Info* );
00075         void replug();
00076 
00077     private:
00078         friend class ConfigWidget;
00079         friend class PluginCheckBox;
00080 
00081         void loadPlugin( Info* );
00082 
00083                 struct Private;
00084                 Private* d;
00085     };
00086 
00087     class ConfigWidget :public QScrollView
00088     {
00089         Q_OBJECT
00090     public:
00091         ConfigWidget( QWidget* parent );
00092                 ~ConfigWidget();
00093     public slots:
00094         void apply();
00095     private:
00096                 struct Private;
00097                 Private* d;
00098     };
00099 }
00100 
00101 #endif /* PLUGINLOADER_H */

Generated on Tue Sep 13 05:01:58 2005 for libKipi by  doxygen 1.4.4