QGIS API Documentation 3.43.0-Master (80be09f213e)
qgssldexportcontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssldexportcontext.h - QgsSldExportContext
3
4 ---------------------
5 begin : 21.12.2022
6 copyright : (C) 2022 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSSLDEXPORTCONTEXT_H
17#define QGSSLDEXPORTCONTEXT_H
18
19#include "qgis.h"
20#include "qgis_core.h"
21
28class CORE_EXPORT QgsSldExportContext
29{
30 public:
31
36
38
39 QgsSldExportContext( const QgsSldExportContext &other ) = default;
41
48 QgsSldExportContext( const Qgis::SldExportOptions &options, const Qgis::SldExportVendorExtension &vendorExtension, const QString &filePath );
49
53 Qgis::SldExportOptions exportOptions() const;
54
58 void setExportOptions( const Qgis::SldExportOptions &exportOptions );
59
63 Qgis::SldExportVendorExtension vendorExtensions() const;
64
68 void setVendorExtension( const Qgis::SldExportVendorExtension &vendorExtension );
69
73 QString exportFilePath() const;
74
78 void setExportFilePath( const QString &exportFilePath );
79
87 QStringList errors() const { return mErrors; }
88
96 void pushError( const QString &error ) { mErrors << error; }
97
105 QStringList warnings() const { return mWarnings; }
106
114 void pushWarning( const QString &warning ) { mWarnings << warning; }
115
122 QVariantMap extraProperties() const;
123
130 void setExtraProperties( const QVariantMap &properties );
131
132 private:
133
136 QString mExportFilePath;
137 QStringList mErrors;
138 QStringList mWarnings;
139 QVariantMap mExtraProperties;
140
141};
142
144
145#endif // QGSSLDEXPORTCONTEXT_H
@ NoOptions
Default SLD export.
SldExportVendorExtension
SLD export vendor extensions, allow the use of vendor extensions when exporting to SLD.
Definition qgis.h:675
@ NoVendorExtension
No vendor extensions.
QFlags< SldExportOption > SldExportOptions
Definition qgis.h:666
Holds SLD export options and other information related to SLD export of a QGIS layer style.
QStringList warnings() const
Returns a list of warnings which occurred during the conversion.
QStringList errors() const
Returns a list of errors which occurred during the conversion.
QgsSldExportContext & operator=(const QgsSldExportContext &other)=default
void pushWarning(const QString &warning)
Pushes a warning message generated during the conversion.
QgsSldExportContext()=default
Constructs a default SLD export context.
~QgsSldExportContext()=default
void pushError(const QString &error)
Pushes a error message generated during the conversion.
QgsSldExportContext(const QgsSldExportContext &other)=default
Q_DECLARE_METATYPE(QgsSldExportContext)