summaryrefslogtreecommitdiffstats
path: root/libkipi/libkipi/pluginloader.h
blob: 8671d31ac20d21338195e1a5fb14b680b3f45cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* ============================================================
 * 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 <tqwidget.h>
#include <tqscrollview.h>


namespace KIPI
{
    class Plugin;
    class Interface;
    class ConfigWidget;

    class LIBKIPI_EXPORT PluginLoader :public TQObject
    {
        Q_OBJECT
  
    public:
        class LIBKIPI_EXPORT Info
        {
		public:
            Info( const TQString& name, const TQString& comment, const TQString& library, bool shouldLoad );
            ~Info();
            TQString name() const;
            
			TQString comment() const;
            
			TQString library() const;
            
			Plugin* plugin() const;
			void setPlugin(Plugin*);
			
            bool shouldLoad() const;
            void setShouldLoad(bool);

		private:
			struct Private;
			Private* d;
        };

        PluginLoader( const TQStringList& ignores, Interface* interface );
        virtual ~PluginLoader();
        void loadPlugins();
        static PluginLoader* instance();
        ConfigWidget* configWidget( TQWidget* parent );

        typedef TQValueList<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 TQScrollView
    {
        Q_OBJECT
  
    public:
        ConfigWidget( TQWidget* parent );
		~ConfigWidget();
    public slots:
        void apply();
    private:
		struct Private;
		Private* d;
    };
}

#endif /* PLUGINLOADER_H */