File indexing completed on 2024-04-21 11:23:19
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2014 Calin Cruceru <crucerucalincristian@gmail.com> 0004 // SPDX-FileCopyrightText: 2015 Constantin Mihalache <mihalache.c94@gmail.com> 0005 // 0006 0007 #ifndef FORMATTEDTEXTWIDGET_H 0008 #define FORMATTEDTEXTWIDGET_H 0009 0010 // Marble 0011 #include "marble_export.h" 0012 0013 //Qt 0014 #include <QWidget> 0015 0016 class QString; 0017 0018 namespace Marble { 0019 0020 class MARBLE_EXPORT FormattedTextWidget : public QWidget 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 explicit FormattedTextWidget(QWidget *parent = nullptr); 0026 ~FormattedTextWidget() override; 0027 0028 void setText( const QString &text ); 0029 const QString text(); 0030 void setReadOnly( bool state ); 0031 0032 private Q_SLOTS: 0033 void toggleDescriptionEditMode( bool isFormattedTextMode = false ); 0034 void setTextCursorBold( bool bold ); 0035 void setTextCursorItalic( bool italic ); 0036 void setTextCursorUnderlined( bool underlined ); 0037 void setTextCursorColor( const QColor &color ); 0038 void setTextCursorFont( const QFont &font ); 0039 void setTextCursorFontSize( const QString &fontSize ); 0040 void addImageToDescription(); 0041 void addLinkToDescription(); 0042 void updateDescriptionEditButtons(); 0043 0044 Q_SIGNALS: 0045 void textUpdated(); 0046 0047 private: 0048 class Private; 0049 Private * const d; 0050 }; 0051 } 0052 0053 #endif // FORMATTEDTEXTWIDGET_H