File indexing completed on 2024-04-14 03:48:00
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2009 Bastian Holst <bastianholst@gmx.de> 0004 // 0005 0006 #ifndef MARBLE_PLUGINABOUTDIALOG_H 0007 #define MARBLE_PLUGINABOUTDIALOG_H 0008 0009 #include <QDialog> 0010 #include <QList> 0011 0012 // Marble 0013 #include "marble_export.h" 0014 #include "PluginInterface.h" 0015 0016 namespace Marble 0017 { 0018 0019 class PluginAboutDialogPrivate; 0020 0021 class MARBLE_EXPORT PluginAboutDialog : public QDialog 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 enum LicenseKey { 0027 // License_Unknown = 0, 0028 // License_GPL = 1, 0029 // License_GPL_V2 = 1, 0030 // License_LGPL = 2, 0031 License_LGPL_V2 = 2 0032 // License_BSD = 3, 0033 // License_Artistic = 4, 0034 // License_QPL = 5, 0035 // License_QPL_V1_0 = 5, 0036 // License_GPL_V3 = 6, 0037 // License_LGPL_V3 = 7 0038 }; 0039 0040 explicit PluginAboutDialog( QWidget *parent = nullptr ); 0041 ~PluginAboutDialog() override; 0042 0043 /** 0044 * Sets the name of the plugin. 0045 */ 0046 void setName( const QString& name ); 0047 0048 /** 0049 * Sets the version of the plugin; 0050 */ 0051 void setVersion( const QString& version ); 0052 0053 /** 0054 * Sets the icon to be displayed at the top of the dialog. 0055 */ 0056 void setIcon( const QIcon& icon ); 0057 0058 /** 0059 * Sets the text displayed in the "About" tab of the dialog. 0060 */ 0061 void setAboutText( const QString& about ); 0062 0063 /** 0064 * Sets the authors working on this plugin. 0065 * @since 0.26.0 0066 */ 0067 void setAuthors(const QVector<PluginAuthor>& authors); 0068 0069 /** 0070 * Sets the text displayed in the "Authors" tab of the dialog. 0071 * @warning You would want to use setAuthors instead. 0072 */ 0073 void setAuthorsText( const QString& authors ); 0074 0075 /** 0076 * Sets the text displayed in the "Data" tab of the dialog. 0077 * An null QString will result into no "Data" tab at all. 0078 */ 0079 void setDataText( const QString& data ); 0080 0081 /** 0082 * Sets the license for the "License Agreement" tab of the dialog. 0083 */ 0084 void setLicense( PluginAboutDialog::LicenseKey license ); 0085 0086 /** 0087 * Sets the text displayed in the "License Agreement" tab of the dialog. 0088 * A null QString will result into the default LGPLv2 license agreement. 0089 * If your plugin is not part of the official Marble distribution, please set it 0090 * manually to the license agreement you prefer (even if it is LGPLv2). 0091 * @warning You would want to use setLicense instead. 0092 */ 0093 void setLicenseAgreementText( const QString& license ); 0094 0095 private: 0096 Q_DISABLE_COPY( PluginAboutDialog ) 0097 0098 PluginAboutDialogPrivate * const d; 0099 }; 0100 0101 } // namespace Marble 0102 0103 #endif