QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgsprojectservervalidator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectservervalidator.h
3 ---------------------------
4 begin : March 2020
5 copyright : (C) 2020 by Etienne Trimaille
6 email : etienne dot trimaille 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 QGSPROJECTSERVERVALIDATOR_H
19#define QGSPROJECTSERVERVALIDATOR_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgslayertreegroup.h"
24#include "qgslayertree.h"
25
26
34{
35
36 public:
37
39
44 {
45 DuplicatedNames = 0,
46 LayerShortName = 1,
47 LayerEncoding = 2,
48 ProjectShortName = 3,
49 ProjectRootNameConflict = 4,
50 };
51
57 static QString displayValidationError( QgsProjectServerValidator::ValidationError error );
58
63 {
64
68 ValidationResult( const QgsProjectServerValidator::ValidationError error, const QVariant &identifier )
69 : error( error )
70 , identifier( identifier )
71 {}
72
77
81 QVariant identifier;
82 };
83
92 static bool validate( QgsProject *project, QList< QgsProjectServerValidator::ValidationResult > &results SIP_OUT );
93
94 private:
95 static void browseLayerTree( QgsLayerTreeGroup *treeGroup, QStringList &owsNames, QStringList &encodingMessages );
96
97};
98
99#endif // QGSPROJECTSERVERVALIDATOR_H
Layer tree group node serves as a container for layers and further groups.
Validates the server specific parts of the configuration of a QGIS project.
QgsProjectServerValidator()=default
ValidationError
Errors that might be raised by the validation process.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
#define SIP_OUT
Definition qgis_sip.h:58
Contains the parameters describing a project validation failure.
ValidationResult(const QgsProjectServerValidator::ValidationError error, const QVariant &identifier)
Constructor for ValidationResult.
QVariant identifier
Identifier related to the error.
QgsProjectServerValidator::ValidationError error
Error which occurred during the validation process.