File indexing completed on 2024-05-05 03:50:45
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org> 0004 // SPDX-FileCopyrightText: 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com> 0005 // 0006 0007 #ifndef MARBLELICENSE_H 0008 #define MARBLELICENSE_H 0009 0010 #include "AbstractFloatItem.h" 0011 0012 class QLabel; 0013 0014 namespace Marble 0015 { 0016 0017 class WidgetGraphicsItem; 0018 0019 /** 0020 * @short The class that displays copyright info 0021 * 0022 */ 0023 0024 class License : public AbstractFloatItem 0025 { 0026 Q_OBJECT 0027 Q_PLUGIN_METADATA(IID "org.kde.marble.License") 0028 Q_INTERFACES( Marble::RenderPluginInterface ) 0029 MARBLE_PLUGIN( License ) 0030 public: 0031 explicit License( const MarbleModel *marbleModel=nullptr ); 0032 ~License() override; 0033 0034 QStringList backendTypes() const override; 0035 QString name() const override; 0036 QString guiString() const override; 0037 QString nameId() const override; 0038 QString version() const override; 0039 QString description() const override; 0040 QString copyrightYears() const override; 0041 QVector<PluginAuthor> pluginAuthors() const override; 0042 QIcon icon () const override; 0043 void initialize () override; 0044 bool isInitialized () const override; 0045 0046 private Q_SLOTS: 0047 void updateLicenseText(); 0048 void toggleLicenseSize(); 0049 void showAboutDialog(); 0050 0051 protected: 0052 bool eventFilter(QObject *, QEvent *e) override; 0053 void contextMenuEvent( QWidget *w, QContextMenuEvent *e ) override; 0054 0055 private: 0056 WidgetGraphicsItem* m_widgetItem; 0057 QLabel* m_label; 0058 bool m_showFullLicense; 0059 QMenu* m_contextMenu; 0060 }; 0061 0062 } 0063 0064 #endif