Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blokkalpluginmanager.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 - 2008 by Martin Mueller                           *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKPLUGINMANAGER_H
00021 #define BLOKPLUGINMANAGER_H
00022 
00023 #include "blokkal_export.h"
00024 
00025 #include <kplugininfo.h>
00026 
00027 #include <QtCore/QObject>
00028 
00029 namespace Blokkal {
00030 class Plugin;
00031 class Protocol;
00032 namespace Ui {
00033 class EditEntryViewFactory;
00034 class BrowseEntryViewFactory;
00035 }
00036 class PluginManagerPrivate;
00046 class BLOKKAL_EXPORT PluginManager : public QObject
00047 {
00048 friend class PluginManagerPrivate;
00049 Q_OBJECT
00050 public:
00057         static PluginManager * self( void );
00058 
00063         KPluginInfo::List availableProtocols( void ) const;
00064 
00069         KPluginInfo::List availableEditEntryViewFactorys( void ) const;
00070 
00075         KPluginInfo::List availableBrowseEntryViewFactorys( void ) const;
00076 
00081         KPluginInfo::List availablePlugins( void ) const;
00082         
00090         Blokkal::Protocol * protocol( const QString & pluginName );
00091 
00100         Blokkal::Ui::EditEntryViewFactory * editEntryViewFactory( const QString & pluginName = QString::null );
00101 
00110         Blokkal::Ui::BrowseEntryViewFactory * browseEntryViewFactory( const QString & pluginName = QString::null );
00111 
00119         Blokkal::Plugin * plugin( const QString & pluginName );
00120 
00126         KPluginInfo pluginInfo( const QString & pluginName ) const;
00127 
00133         KPluginInfo pluginInfo( const Plugin * plugin ) const;
00134 
00135 public Q_SLOTS:
00141         void unloadPlugin( const QString & pluginName );
00142 
00146         void unloadAllPlugins( void );
00147 
00152         void shutdown( void );
00153 
00154 Q_SIGNALS:
00158         void pluginLoaded( Blokkal::Plugin * plugin );
00159         
00160 protected Q_SLOTS:
00165         void deletePlugin( Blokkal::Plugin * plugin );
00166 
00171         void removePlugin( QObject * plugin );
00172 
00180         Blokkal::Plugin * loadPlugin( const QString & pluginName );
00181         
00182 private:
00183         PluginManager( void );
00184         ~PluginManager( void );
00185 };
00186 
00187 }
00188 
00189 #endif