1/* This file is part of the KDE project
2
3 Copyright (C) 2006 Dario Massarin <nekkar@libero.it>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9*/
10
11#ifndef KGET_EXPORT_H
12#define KGET_EXPORT_H
13
14#include <KPluginFactory>
15#include <KPluginLoader>
16
17/* needed for KDE_EXPORT macros */
18#include <kdemacros.h>
19
20/* export statements for unix */
21#ifdef MAKE_KGETCORE_LIB
22# define KGET_EXPORT KDE_EXPORT
23#else
24# define KGET_EXPORT KDE_IMPORT
25#endif
26
27
28/**
29 * @short Declares a class as plugin.
30 *
31 * Exports a common symbol in a shared library used as an entry point for
32 * the creation of an istance of the class.
33 *
34 * Usage example:
35 * KGET_EXPORT_PLUGIN( CoolKgetPlugin );
36 * class CoolKgetPlugin : public KGetPlugin {
37 * ....
38 * }
39 */
40#define KGET_EXPORT_PLUGIN( classname ) \
41 K_PLUGIN_FACTORY( KGetFactory, registerPlugin< classname >(); ) \
42 K_EXPORT_PLUGIN( KGetFactory("classname") )
43
44#define KGET_EXPORT_PLUGIN_CONFIG( classname ) \
45 K_PLUGIN_FACTORY( KGetFactory, registerPlugin< classname >(); ) \
46 K_EXPORT_PLUGIN( KGetFactory( "classname" ) )
47
48#endif
49