File indexing completed on 2025-01-05 03:59:34

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, 2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0006 
0007 #ifndef MARBLE_SEARCHRUNNER_H
0008 #define MARBLE_SEARCHRUNNER_H
0009 
0010 #include "digikam_export.h"
0011 
0012 #include <QObject>
0013 #include <QVector>
0014 
0015 #include "GeoDataPlacemark.h"
0016 
0017 namespace Marble
0018 {
0019 
0020 class GeoDataLatLonBox;
0021 class MarbleModel;
0022 
0023 class DIGIKAM_EXPORT SearchRunner : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit SearchRunner( QObject *parent = nullptr );
0029 
0030     /**
0031      * Stores a pointer to the currently used model
0032      */
0033     void setModel( const MarbleModel *model );
0034 
0035     /**
0036      * Start a placemark search. Called by MarbleRunnerManager, runners
0037      * are expected to return the result via the searchFinished signal.
0038      * If implemented in a plugin, make sure to include Search in the
0039      * plugin capabilities, otherwise MarbleRunnerManager will ignore the plugin
0040      */
0041     virtual void search( const QString &searchTerm, const GeoDataLatLonBox &preferred ) = 0;
0042 
0043 Q_SIGNALS:
0044     /**
0045      * This is Q_EMITted to indicate that the runner has finished the placemark search.
0046      * @param result the result of the search.
0047      */
0048     void searchFinished( const QVector<GeoDataPlacemark*>& result );
0049 
0050 protected:
0051     /**
0052      * Access to the currently used model, or null if no was set with @see setModel
0053      */
0054     const MarbleModel *model() const;
0055 
0056 private:
0057     const MarbleModel *m_model;
0058 };
0059 
0060 }
0061 
0062 #endif