1 /*************************************************************************** 2 qgstextannotationdialog.h 3 ------------------------ 4 begin : February 24, 2010 5 copyright : (C) 2010 by Marco Hugentobler 6 email : marco dot hugentobler at hugis dot net 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef QGSTEXTANNOTATIONDIALOG_H 19 #define QGSTEXTANNOTATIONDIALOG_H 20 21 #include "ui_qgstextannotationdialogbase.h" 22 #include "qgis_app.h" 23 #include <memory> 24 25 class QgsAnnotationWidget; 26 class QgsMapCanvasAnnotationItem; 27 28 class APP_EXPORT QgsTextAnnotationDialog: public QDialog, private Ui::QgsTextAnnotationDialogBase 29 { 30 Q_OBJECT 31 public: 32 QgsTextAnnotationDialog( QgsMapCanvasAnnotationItem *item, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() ); 33 34 protected: 35 36 void showEvent( QShowEvent *event ) override; 37 38 private: 39 QgsMapCanvasAnnotationItem *mItem = nullptr; 40 //! Text document (a clone of the annotation items document) 41 std::unique_ptr< QTextDocument > mTextDocument; 42 QgsAnnotationWidget *mEmbeddedWidget = nullptr; 43 44 void blockAllSignals( bool block ); 45 46 private slots: 47 void applyTextToItem(); 48 void changeCurrentFormat(); 49 void mFontColorButton_colorChanged( const QColor &color ); 50 void setCurrentFontPropertiesToGui(); 51 void deleteItem(); 52 void mButtonBox_clicked( QAbstractButton *button ); 53 void backgroundColorChanged( const QColor &color ); 54 void showHelp(); 55 }; 56 57 #endif // QGSTEXTANNOTATIONDIALOG_H 58