• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • core
  • plugin
plugin.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2005 by Enrico Ros <eros.kde@email.it>
4  based on amarok code Copyright (C) 2004 by Mark Kretschmann <markey@web.de>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 */
11 
12 #ifndef KGET_PLUGIN_H
13 #define KGET_PLUGIN_H
14 
15 /* KGet plugins -How they work- [enrico: 0.6]
16  *
17  * Here is a generic framework for plugins usage. Since the purpose of a
18  * plugin is providing some type of well known functionality, there are
19  * some requirements that must be satisfied. In fact a plugin must:
20  * - inherit KGetPlugin interface or a subclass of that
21  * - declare that the class IS a kget plugin (using a macro)
22  * - declare its 'type' to the loader (using a .desktop file)
23  *
24  * Plugins providing the same functionality (TransferFactory for example)
25  * must inherit the same interface and be declared as plugins of the same
26  * type. In that case all the plugins will inherit and implement the
27  * TransferFactory class and provide a .desktop file that identify them
28  * as belonging to the same type (X-KDE-KGet-pluginType=TransferFactory).
29  *
30  * Loading. This operation is done by using KDE framework. So we define a
31  * new ServiceType in the kget_plugin.desktop file. KGet plugins service
32  * is called "KGet/Plugin". In the Desktop file that describes a plugin
33  * the "X-KDE-ServiceType" is set to to "KGet/Plugin" and other fields
34  * are set as described in the service type definition.
35  * As an example say that we need "InputFilter" plugins. In that case we
36  * can use KTrader to enumerate the plugins of that type installed in the
37  * system and after getting the name of the libraries they're in, load
38  * them. In that case the Input object that loaded the plugins must know
39  * how to treat them (and that is easy, since they all reimplemented an
40  * 'input plugin class' providing necessary information).
41  *
42  * @see: kget_plugin.desktop - for servicetype definition.
43  * @see: other headers in the dir - for plugin types definition.
44  */
45 
46 #include "kget_export.h"
47 
48 #include <QObject>
49 #include <QVariantList>
50 
55  const int FrameworkVersion = 1;
56 
61 class KGET_EXPORT KGetPlugin : public QObject
62 {
63  Q_OBJECT
64  public:
65  KGetPlugin(QObject *parent, const QVariantList &args);
66  virtual ~KGetPlugin();
67 
68  /*
69  // set and retrieve properties
70  void addPluginProperty( const QString & key, const QString & value );
71  bool hasPluginProperty( const QString & key );
72  QString pluginProperty( const QString & key );
73 
74  reimplement this to set the type of the plugin
75  enum PluginType { PreProcessing, Factory, PostProcessing }
76  virtual PluginType pluginType() = 0;
77  */
78 
79  private:
80  //QMap< QString, QString > m_properties;
81 
82 
83 };
84 
85 #endif
FrameworkVersion
const int FrameworkVersion
Bump this number whenever the plugin framework gets incompatible with older versions.
Definition: plugin.h:55
QObject
kget_export.h
KGetPlugin
Base class for kget plugins.
Definition: plugin.h:61
KGET_EXPORT
#define KGET_EXPORT
Definition: kget_export.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal