pluginmanager.h
00001 /*************************************************************************** 00002 begin : 2004/03/12 00003 copyright : (C) Mark Kretschmann 00004 email : markey@web.de 00005 ***************************************************************************/ 00006 00007 /*************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef AKREGATOR_PLUGINMANAGER_H 00017 #define AKREGATOR_PLUGINMANAGER_H 00018 00019 #include <vector> 00020 00021 #include <kservice.h> 00022 #include <ktrader.h> 00023 00024 00025 class KLibrary; 00026 namespace Akregator { 00027 00028 class Plugin; 00029 class PluginManager 00030 { 00031 public: 00033 static const int FrameworkVersion = 1; 00034 00058 static KTrader::OfferList query( const TQString& constraint = TQString() ); 00059 00067 static Akregator::Plugin* createFromQuery( const TQString& constraint = TQString() ); 00068 00074 static Akregator::Plugin* createFromService( const KService::Ptr service ); 00075 00080 static void unload( Akregator::Plugin* plugin ); 00081 00087 static KService::Ptr getService( const Akregator::Plugin* plugin ); 00088 00093 static void dump( const KService::Ptr service ); 00094 00099 static void showAbout( const TQString& constraint ); 00100 00101 private: 00102 struct StoreItem { 00103 Akregator::Plugin* plugin; 00104 KLibrary* library; 00105 KService::Ptr service; 00106 }; 00107 00108 static std::vector<StoreItem>::iterator lookupPlugin( const Akregator::Plugin* plugin ); 00109 00110 //attributes: 00111 static std::vector<StoreItem> m_store; 00112 }; 00113 } 00114 00115 #endif /* AKREGATOR_PLUGINMANAGER_H */ 00116