QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
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:
35
37
38 QgsSldExportContext( const QgsSldExportContext &other ) = default;
40
47 QgsSldExportContext( const Qgis::SldExportOptions &options, const Qgis::SldExportVendorExtension &vendorExtension, const QString &filePath );
48
53
58
63
67 void setVendorExtension( const Qgis::SldExportVendorExtension &vendorExtension );
68
72 QString exportFilePath() const;
73
77 void setExportFilePath( const QString &exportFilePath );
78
86 QStringList errors() const { return mErrors; }
87
95 void pushError( const QString &error ) { mErrors << error; }
96
104 QStringList warnings() const { return mWarnings; }
105
113 void pushWarning( const QString &warning ) { mWarnings << warning; }
114
121 QVariantMap extraProperties() const;
122
129 void setExtraProperties( const QVariantMap &properties );
130
131 private:
134 QString mExportFilePath;
135 QStringList mErrors;
136 QStringList mWarnings;
137 QVariantMap mExtraProperties;
138};
139
141
142#endif // QGSSLDEXPORTCONTEXT_H
@ NoOptions
Default SLD export.
Definition qgis.h:723
SldExportVendorExtension
SLD export vendor extensions, allow the use of vendor extensions when exporting to SLD.
Definition qgis.h:737
@ NoVendorExtension
No vendor extensions.
Definition qgis.h:738
QFlags< SldExportOption > SldExportOptions
Definition qgis.h:728
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.
Qgis::SldExportVendorExtension vendorExtensions() const
Returns the vendor extension enabled for the SLD export.
QString exportFilePath() const
Returns the export file path for the SLD.
QStringList errors() const
Returns a list of errors which occurred during the conversion.
void setExportFilePath(const QString &exportFilePath)
Sets the export file path for the SLD to exportFilePath.
QgsSldExportContext & operator=(const QgsSldExportContext &other)=default
void pushWarning(const QString &warning)
Pushes a warning message generated during the conversion.
void setExportOptions(const Qgis::SldExportOptions &exportOptions)
Set export options to exportOptions.
Qgis::SldExportOptions exportOptions() const
Returns the export options.
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
void setVendorExtension(const Qgis::SldExportVendorExtension &vendorExtension)
Sets the vendor extensions to vendorExtension.
Q_DECLARE_METATYPE(QgsSldExportContext)