summaryrefslogtreecommitdiffstats
path: root/src/extension/loader.h
blob: abfb4fb460f4897ba34a4ab1e36f25ad4b9d8af7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-License-Identifier: GPL-2.0-or-later
/** @file
 * Loader for external plug-ins.
 *//*
 *
 * Authors:
 *   Moritz Eberl <moritz@semiodesk.com>
 *
 * Copyright (C) 2016 Authors
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#ifndef INKSCAPE_EXTENSION_LOADER_H_
#define INKSCAPE_EXTENSION_LOADER_H_

#include "extension.h"


namespace Inkscape {

namespace XML {
class Document;
}

namespace Extension {

/** This class contains the mechanism to load c++ plugins dynamically.
*/
class Loader {

public:
    /**
     * Sets a base directory where to look for the actual plugin to load.
     *
     * @param dir is the path where the plugin should be loaded from.
     */
    void set_base_directory(std::string const &dir) {
        _baseDirectory = dir;
    }

    /**
     * Loads plugin dependencies which are needed for the plugin to load.
     *
     * @param dep
     */
    bool load_dependency(Dependency *dep);

    /**
     * Load the actual implementation of a plugin supplied by the plugin.
     *
     * @param doc The xml representation of the INX extension configuration.
     * @return The implementation of the extension loaded from the plugin.
     */
    Implementation::Implementation *load_implementation(Inkscape::XML::Document *doc);

private:
    std::string _baseDirectory; /**< The base directory to load a plugin from */


};

} // namespace Extension
} // namespace Inkscape */

#endif // _LOADER_H_

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace .0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim:filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99: