akregator/src

pluginmanager.h
1/***************************************************************************
2begin : 2004/03/12
3copyright : (C) Mark Kretschmann
4email : markey@web.de
5***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef AKREGATOR_PLUGINMANAGER_H
17#define AKREGATOR_PLUGINMANAGER_H
18
19#include <vector>
20
21#include <kservice.h>
22#include <ktrader.h>
23
24
25class KLibrary;
26namespace Akregator {
27
28class Plugin;
29class PluginManager
30{
31 public:
33 static const int FrameworkVersion = 1;
34
58 static TDETrader::OfferList query( const TQString& constraint = TQString() );
59
67 static Akregator::Plugin* createFromQuery( const TQString& constraint = TQString() );
68
74 static Akregator::Plugin* createFromService( const KService::Ptr service );
75
80 static void unload( Akregator::Plugin* plugin );
81
87 static KService::Ptr getService( const Akregator::Plugin* plugin );
88
93 static void dump( const KService::Ptr service );
94
99 static void showAbout( const TQString& constraint );
100
101 private:
102 struct StoreItem {
103 Akregator::Plugin* plugin;
104 KLibrary* library;
105 KService::Ptr service;
106 };
107
108 static std::vector<StoreItem>::iterator lookupPlugin( const Akregator::Plugin* plugin );
109
110 //attributes:
111 static std::vector<StoreItem> m_store;
112};
113}
114
115#endif /* AKREGATOR_PLUGINMANAGER_H */
116