PluginManager.h 2 KB
Newer Older
Torsten Rahn's avatar
Torsten Rahn committed
1
//
2
// This file is part of the Marble Virtual Globe.
Torsten Rahn's avatar
Torsten Rahn committed
3
4
5
6
7
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
8
9
// Copyright 2006-2008 Torsten Rahn <tackat@kde.org>
// Copyright 2009      Jens-Michael Hoffmann <jensmh@gmx.de>
Torsten Rahn's avatar
Torsten Rahn committed
10
11
//

12
13
#ifndef MARBLE_PLUGINMANAGER_H
#define MARBLE_PLUGINMANAGER_H
Torsten Rahn's avatar
Torsten Rahn committed
14

15
#include <QtCore/QList>
Torsten Rahn's avatar
Torsten Rahn committed
16
#include <QtCore/QObject>
17
#include "marble_export.h"
Torsten Rahn's avatar
Torsten Rahn committed
18

19

20
21
22
namespace Marble
{

23
class RenderPlugin;
24
class NetworkPlugin;
25
class PositionProviderPlugin;
26
class AbstractFloatItem;
Torsten Rahn's avatar
Torsten Rahn committed
27
class PluginManagerPrivate;
28
class RunnerPlugin;
Torsten Rahn's avatar
Torsten Rahn committed
29

Torsten Rahn's avatar
Torsten Rahn committed
30
31
32
/**
 * @short The class that handles Marble's plugins.
 *
33
 * Ownership policy for plugins:
34
 *
35
36
37
38
 * On every invocation of createRenderPlugins, createNetworkPlugins and
 * createFloatItems the PluginManager creates new objects and transfers
 * ownership to the calling site. In order to create
 * the objects, the PluginManager internally has a list of the plugins
39
40
 * which are owned by the PluginManager and destroyed by it.
 *
Torsten Rahn's avatar
Torsten Rahn committed
41
42
 */

43
class MARBLE_EXPORT PluginManager : public QObject
Torsten Rahn's avatar
Torsten Rahn committed
44
45
46
47
{
    Q_OBJECT

 public:
Torsten Rahn's avatar
Torsten Rahn committed
48
    explicit PluginManager( QObject *parent = 0 );
Torsten Rahn's avatar
Torsten Rahn committed
49
50
51
    ~PluginManager();

    /**
52
53
     * This methods creates a new set of plugins and transfers ownership
     * of them to the client.
Torsten Rahn's avatar
Torsten Rahn committed
54
     */
55
56
57
    QList<RenderPlugin *> createRenderPlugins() const;

    /**
58
59
     * This methods creates a new set of plugins and transfers ownership
     * of them to the client.
60
     */
61
    QList<NetworkPlugin *> createNetworkPlugins() const;
Torsten Rahn's avatar
Torsten Rahn committed
62

63
64
65
66
67
68
    /**
     * This methods creates a new set of plugins and transfers ownership
     * of them to the client.
     */
    QList<PositionProviderPlugin *> createPositionProviderPlugins() const;

69
70
71
72
73
74
    /**
     * Returns all runner plugins.
     * @note: Runner plugins are owned by the PluginManager, do not delete them
     */
    QList<RunnerPlugin *> runnerPlugins() const;

75
76
77
 private:
    Q_DISABLE_COPY( PluginManager )

Torsten Rahn's avatar
Torsten Rahn committed
78
    PluginManagerPrivate  * const d;
Torsten Rahn's avatar
Torsten Rahn committed
79
80
};

81
}
Torsten Rahn's avatar
Torsten Rahn committed
82

83
#endif