QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgsalgorithmlayoutatlastopdf.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsalgorithmlayoutatlastopdf.h
3 ---------------------
4 begin : August 2020
5 copyright : (C) 2020 by Mathieu Pellerin
6 email : nirvn dot asia at gmail dot com
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 QGSALGORITHMLAYOUTATLASTOPDF_H
19#define QGSALGORITHMLAYOUTATLASTOPDF_H
20
21
22#include "qgis_sip.h"
23#include "qgslayoutexporter.h"
25
26#define SIP_NO_FILE
27
28class QgsLayoutAtlas;
29
31
35class QgsLayoutAtlasToPdfAlgorithmBase : public QgsProcessingAlgorithm
36{
37 public:
38 QgsLayoutAtlasToPdfAlgorithmBase() = default;
39 void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
41 QStringList tags() const override;
42 QString group() const override;
43 QString groupId() const override;
44
45 QgsLayoutAtlas *atlas();
46 QgsLayoutExporter exporter();
48 QString error();
49
50 protected:
51 QVariantMap processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
52
53 virtual QVariantMap exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0;
54};
55
56
60class QgsLayoutAtlasToPdfAlgorithm : public QgsLayoutAtlasToPdfAlgorithmBase
61{
62 public:
63 QgsLayoutAtlasToPdfAlgorithm() = default;
64 void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
65 QString name() const override;
66 QString displayName() const override;
67 QString shortDescription() const override;
68 QString shortHelpString() const override;
69 QgsLayoutAtlasToPdfAlgorithm *createInstance() const override SIP_FACTORY;
70
71 protected:
72 QVariantMap exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
73};
74
78class QgsLayoutAtlasToMultiplePdfAlgorithm : public QgsLayoutAtlasToPdfAlgorithmBase
79{
80 public:
81 QgsLayoutAtlasToMultiplePdfAlgorithm() = default;
82 void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
83 QString name() const override;
84 QString displayName() const override;
85 QString shortDescription() const override;
86 QString shortHelpString() const override;
87 QgsLayoutAtlasToMultiplePdfAlgorithm *createInstance() const override SIP_FACTORY;
88
89 protected:
90 QVariantMap exportAtlas( QgsLayoutAtlas *atlas, const QgsLayoutExporter &exporter, const QgsLayoutExporter::PdfExportSettings &settings, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
91};
92
94
95#endif // QGSALGORITHMLAYOUTATLASTOPDF_H
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
Definition qgis.h:3695
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
Handles rendering and exports of layouts to various formats.
Abstract base class for processing algorithms.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
virtual QVariantMap processAlgorithm(const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback)=0
Runs the algorithm using the specified parameters.
virtual QStringList tags() const
Returns a list of tags which relate to the algorithm, and are used to assist users in searching for s...
virtual void initAlgorithm(const QVariantMap &configuration=QVariantMap())=0
Initializes the algorithm using the specified configuration.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
#define SIP_FACTORY
Definition qgis_sip.h:83
Contains settings relating to exporting layouts to PDF.