File indexing completed on 2024-05-05 17:34:02

0001 /*
0002  *   SPDX-FileCopyrightText: 2007-2009 Shawn Starr <shawn.starr@rogers.com>
0003  *   SPDX-FileCopyrightText: 2012 Luís Gabriel Lima <lampih@gmail.com>
0004  *   SPDX-FileCopyrightText: 2017-2018 Friedrich W. H. Kossebau <kossebau@kde.org>
0005  *   SPDX-FileCopyrightText: 2022 Ismael Asensio <isma.af@gmail.com>
0006  *
0007  *   SPDX-License-Identifier: GPL-2.0-or-later
0008  */
0009 
0010 #ifndef WEATHERAPPLET_H
0011 #define WEATHERAPPLET_H
0012 
0013 #include <Plasma/DataEngineConsumer>
0014 
0015 #include <KUnitConversion/Converter>
0016 #include <KUnitConversion/Unit>
0017 
0018 #include <Plasma/Applet>
0019 
0020 class WeatherApplet : public Plasma::Applet, public Plasma::DataEngineConsumer
0021 {
0022     Q_OBJECT
0023     // used for making this information available to the config pages
0024     Q_PROPERTY(bool needsToBeSquare MEMBER m_needsToBeSquare NOTIFY needsToBeSquareChanged FINAL)
0025 
0026     Q_PROPERTY(QVariantMap providers MEMBER m_providers NOTIFY providersChanged FINAL)
0027 
0028 public:
0029     WeatherApplet(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
0030     ~WeatherApplet() override;
0031 
0032     void init() override;
0033 
0034 Q_SIGNALS:
0035     void needsToBeSquareChanged();
0036     void providersChanged();
0037 
0038 private:
0039     void migrateConfig();
0040     void setDefaultUnits();
0041 
0042 private:
0043     QVariantMap m_providers;
0044     bool m_needsToBeSquare = false;
0045 };
0046 
0047 #endif