File indexing completed on 2024-04-28 03:50:20
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2011 Daniel Marth <danielmarth@gmx.at> 0004 // 0005 0006 #ifndef OPENCACHINGITEM_H 0007 #define OPENCACHINGITEM_H 0008 0009 #include "AbstractDataPluginItem.h" 0010 #include "OpenCachingCache.h" 0011 0012 #include <QPixmap> 0013 0014 class QFont; 0015 0016 namespace Ui 0017 { 0018 class OpenCachingCacheDialog; 0019 } 0020 0021 namespace Marble 0022 { 0023 0024 /** 0025 * Item representing a single cache. 0026 */ 0027 class OpenCachingItem : public AbstractDataPluginItem 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 OpenCachingItem( const OpenCachingCache& cache, QObject *parent ); 0033 0034 ~OpenCachingItem(); 0035 0036 // Returns the item type of the item. 0037 QString itemType() const; 0038 0039 // Returns true if the item is paintable 0040 bool initialized(); 0041 0042 // Here the item gets painted 0043 void paint( GeoPainter *painter, ViewportParams *viewport, 0044 const QString& renderPos, GeoSceneLayer * layer = 0 ); 0045 0046 QAction *action(); 0047 0048 bool operator<( const AbstractDataPluginItem *other ) const; 0049 0050 public Q_SLOTS: 0051 void showInfoDialog(); 0052 0053 private: 0054 void updateTooltip(); 0055 0056 QDialog *infoDialog(); 0057 0058 OpenCachingCache m_cache; ///< Information about the cache. 0059 0060 Ui::OpenCachingCacheDialog *m_ui; ///< Dialog displaying information about the cache. 0061 QDialog *m_infoDialog; 0062 QAction *m_action; 0063 0064 int m_logIndex; ///< Index of the currently displayed log entry. 0065 0066 static QFont s_font; 0067 static QPixmap s_icon; 0068 0069 private Q_SLOTS: 0070 void updateDescriptionLanguage( const QString& language ); 0071 0072 void nextLogEntry(); ///< Display next log entry. 0073 0074 void previousLogEntry(); ///< Display previous log entry. 0075 }; 0076 0077 } 0078 #endif // OPENCACHINGITEM_H