File indexing completed on 2024-04-28 15:16:00

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
0005 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0006 //
0007 
0008 #ifndef MARBLE_PARSERUNNERPLUGIN_H
0009 #define MARBLE_PARSERUNNERPLUGIN_H
0010 
0011 #include <QObject>
0012 #include "PluginInterface.h"
0013 
0014 namespace Marble
0015 {
0016 
0017 class ParsingRunner;
0018 
0019 /**
0020   * A plugin for Marble to execute a parsing task.
0021   */
0022 class MARBLE_EXPORT ParseRunnerPlugin : public QObject, public PluginInterface
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     /** Constructor with optional parent object */
0028     explicit ParseRunnerPlugin( QObject* parent = nullptr );
0029 
0030     /** Destructor */
0031     ~ParseRunnerPlugin() override;
0032 
0033     /**
0034       * Returns a short description of the supported file format.
0035       *
0036       * Example: "Google Earth KML"
0037       */
0038     virtual QString fileFormatDescription() const = 0;
0039 
0040     /**
0041       * Returns the file extensions associated with the file format.
0042       *
0043       * Example: "kml", "kmz"
0044       */
0045     virtual QStringList fileExtensions() const = 0;
0046 
0047     /** Plugin factory method to create a new runner instance.
0048       * Method caller gets ownership of the returned object
0049       */
0050     virtual ParsingRunner *newRunner() const = 0;
0051 
0052     // Overridden methods with default implementations
0053 
0054     QIcon icon() const override;
0055 
0056 private:
0057     class Private;
0058     Private *const d;
0059 };
0060 
0061 }
0062 
0063 Q_DECLARE_INTERFACE( Marble::ParseRunnerPlugin, "org.kde.Marble.ParseRunnerPlugin/1.01" )
0064 
0065 #endif // MARBLE_PARSERUNNERPLUGIN_H