QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgslayouthtmlwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayouthtmlwidget.h
3  ---------------------
4  begin : November 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSLAYOUTHTMLWIDGET_H
16 #define QGSLAYOUTHTMLWIDGET_H
17 
18 // We don't want to expose this in the public API
19 #define SIP_NO_FILE
20 
21 #include "qgis_gui.h"
22 #include "ui_qgslayouthtmlwidgetbase.h"
23 #include "qgslayoutitemwidget.h"
24 
25 class QgsLayoutItemHtml;
26 class QgsLayoutFrame;
27 class QgsCodeEditorHTML;
28 class QgsCodeEditorCSS;
29 
37 class GUI_EXPORT QgsLayoutHtmlWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutHtmlWidgetBase
38 {
39  Q_OBJECT
40  public:
42  QgsLayoutHtmlWidget() = delete;
45  void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
46 
47  protected:
48 
49  bool setNewItem( QgsLayoutItem *item ) override;
50 
51  private slots:
52  void mUrlLineEdit_editingFinished();
53  void mFileToolButton_clicked();
54  void mResizeModeComboBox_currentIndexChanged( int index );
55  void mEvaluateExpressionsCheckbox_toggled( bool checked );
56  void mUseSmartBreaksCheckBox_toggled( bool checked );
57  void mMaxDistanceSpinBox_valueChanged( double val );
58  void htmlEditorChanged();
59  void stylesheetEditorChanged();
60  void mUserStylesheetCheckBox_toggled( bool checked );
61  void mRadioManualSource_clicked( bool checked );
62  void mRadioUrlSource_clicked( bool checked );
63  void mInsertExpressionButton_clicked();
64 
65  void mReloadPushButton_clicked();
66  void mAddFramePushButton_clicked();
67  void mEmptyFrameCheckBox_toggled( bool checked );
68  void mHideEmptyBgCheckBox_toggled( bool checked );
69 
71  void setGuiElementValues();
72 
73  protected slots:
75  void populateDataDefinedButtons();
76 
77  private:
78 
79  void blockSignals( bool block );
80 
81  QPointer< QgsLayoutItemHtml > mHtml;
82  QPointer< QgsLayoutFrame > mFrame;
83  QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
84 
85  QgsCodeEditorHTML *mHtmlEditor = nullptr;
86  QgsCodeEditorCSS *mStylesheetEditor = nullptr;
87 };
88 
89 #endif // QGSLAYOUTHTMLWIDGET_H
A CSS editor based on QScintilla2.
A HTML editor based on QScintilla2.
Base class for frame items, which form a layout multiframe item.
A widget for configuring layout html items.
QgsLayoutHtmlWidget()=delete
constructor
A base class for property widgets for layout items.
virtual bool setNewItem(QgsLayoutItem *item)
Attempts to update the widget to show the properties for the specified item.
virtual void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
A layout multiframe subclass for HTML content.
A widget for controlling the common properties of layout items (e.g.
Base class for graphical items within a QgsLayout.
Interface for master layout type objects, such as print layouts and reports.