File indexing completed on 2024-04-28 03:50:14

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
0004 //
0005 
0006 #ifndef EARTHQUAKEPLUGIN_H
0007 #define EARTHQUAKEPLUGIN_H
0008 
0009 #include "AbstractDataPlugin.h"
0010 #include "DialogConfigurationInterface.h"
0011 
0012 #include <QDateTime>
0013 
0014 namespace Ui
0015 {
0016     class EarthquakeConfigWidget;
0017 }
0018 
0019 namespace Marble
0020 {
0021 
0022 class EarthquakePlugin : public AbstractDataPlugin, public DialogConfigurationInterface
0023 {
0024     Q_OBJECT
0025     Q_PLUGIN_METADATA(IID "org.kde.marble.EarthquakePlugin")
0026 
0027     Q_INTERFACES( Marble::RenderPluginInterface )
0028     Q_INTERFACES( Marble::DialogConfigurationInterface )
0029 
0030     MARBLE_PLUGIN( EarthquakePlugin )
0031 
0032 public:
0033     EarthquakePlugin();
0034 
0035     explicit EarthquakePlugin( const MarbleModel *marbleModel );
0036 
0037     void initialize() override;
0038 
0039     QString name() const override;
0040 
0041     QString guiString() const override;
0042 
0043     QString nameId() const override;
0044 
0045     QString version() const override;
0046 
0047     QString description() const override;
0048 
0049     QString copyrightYears() const override;
0050 
0051     QVector<PluginAuthor> pluginAuthors() const override;
0052 
0053     QIcon icon() const override;
0054 
0055     QDialog *configDialog() override;
0056 
0057     /**
0058      * @return: The settings of the item.
0059      */
0060     QHash<QString,QVariant> settings() const override;
0061 
0062     /**
0063      * Set the settings of the item.
0064      */
0065     void setSettings( const QHash<QString,QVariant> &settings ) override;
0066 
0067 public Q_SLOTS:
0068     void readSettings();
0069     void writeSettings();
0070     void updateModel();
0071 
0072 private:
0073     Ui::EarthquakeConfigWidget *m_ui;
0074     QDialog *m_configDialog;
0075     qreal m_minMagnitude;
0076     QDateTime m_startDate;
0077     QDateTime m_endDate;
0078     int m_pastDays;
0079     bool m_timeRangeNPastDays;
0080     int m_numResults;
0081     int m_maximumNumberOfItems;
0082     
0083 private Q_SLOTS:
0084     void validateDateRange();
0085 };
0086 
0087 }
0088 
0089 #endif // EARTHQUAKEPLUGIN_H