summaryrefslogtreecommitdiffstats
path: root/libkipi/libkipi/pluginloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'libkipi/libkipi/pluginloader.h')
-rw-r--r--libkipi/libkipi/pluginloader.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/libkipi/libkipi/pluginloader.h b/libkipi/libkipi/pluginloader.h
new file mode 100644
index 0000000..28455ca
--- /dev/null
+++ b/libkipi/libkipi/pluginloader.h
@@ -0,0 +1,102 @@
+/* ============================================================
+ * File : pluginloader.h
+ * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by Renchi Raju
+
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef KIPI_PLUGINLOADER_H
+#define KIPI_PLUGINLOADER_H
+
+#include "libkipi/interface.h"
+#include "libkipi/libkipi_export.h"
+#include <qwidget.h>
+#include <qscrollview.h>
+
+
+namespace KIPI
+{
+ class Plugin;
+ class Interface;
+ class ConfigWidget;
+
+ class LIBKIPI_EXPORT PluginLoader :public QObject
+ {
+ Q_OBJECT
+ public:
+ class LIBKIPI_EXPORT Info
+ {
+ public:
+ Info( const QString& name, const QString& comment, const QString& library, bool shouldLoad );
+ ~Info();
+ QString name() const;
+
+ QString comment() const;
+
+ QString library() const;
+
+ Plugin* plugin() const;
+ void setPlugin(Plugin*);
+
+ bool shouldLoad() const;
+ void setShouldLoad(bool);
+
+ private:
+ struct Private;
+ Private* d;
+ };
+
+ PluginLoader( const QStringList& ignores, Interface* interface );
+ virtual ~PluginLoader();
+ void loadPlugins();
+ static PluginLoader* instance();
+ ConfigWidget* configWidget( QWidget* parent );
+
+ typedef QValueList<Info*> PluginList;
+
+ const PluginList& pluginList();
+
+ void loadPlugin( Info* );
+
+ signals:
+ void plug( KIPI::PluginLoader::Info* );
+ void unplug( KIPI::PluginLoader::Info* );
+ void replug();
+
+ private:
+ friend class ConfigWidget;
+ friend class PluginCheckBox;
+
+ struct Private;
+ Private* d;
+ };
+
+ class LIBKIPI_EXPORT ConfigWidget :public QScrollView
+ {
+ Q_OBJECT
+ public:
+ ConfigWidget( QWidget* parent );
+ ~ConfigWidget();
+ public slots:
+ void apply();
+ private:
+ struct Private;
+ Private* d;
+ };
+}
+
+#endif /* PLUGINLOADER_H */