File indexing completed on 2024-04-28 03:50:14
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Utku Aydin <utkuaydin34@gmail.com> 0004 // 0005 0006 0007 #ifndef EARTHQUAKEITEM_H 0008 #define EARTHQUAKEITEM_H 0009 0010 #include "AbstractDataPluginItem.h" 0011 0012 #include <QDateTime> 0013 #include <QFont> 0014 0015 namespace Marble 0016 { 0017 0018 class EarthquakeItem : public AbstractDataPluginItem 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 explicit EarthquakeItem( QObject *parent ); 0024 0025 ~EarthquakeItem() override; 0026 0027 // Returns true if the item is paintable 0028 bool initialized() const override; 0029 0030 // Here the item gets painted 0031 void paint( QPainter *painter ) override; 0032 0033 bool operator<( const AbstractDataPluginItem *other ) const override; 0034 0035 // Magnitude whose value we use to determine circle's diameter 0036 double magnitude() const; 0037 0038 void setMagnitude( double magnitude ); 0039 0040 void setDateTime( const QDateTime &dateTime ); 0041 0042 QDateTime dateTime() const; 0043 0044 /** Earthquake's depth in km */ 0045 double depth() const; 0046 0047 void setDepth( double depth ); 0048 0049 private: 0050 void updateTooltip(); 0051 0052 double m_magnitude; 0053 0054 double m_depth; 0055 0056 QDateTime m_dateTime; 0057 0058 static const QFont s_font; 0059 }; 0060 0061 } 0062 #endif // EARTHQUAKEITEM_H