QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgslayermetadatavalidator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayermetadatavalidator.h
3  ---------------------------
4  begin : April 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson 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 QGSLAYERMETADATAVALIDATOR_H
19 #define QGSLAYERMETADATAVALIDATOR_H
20 
21 #include "qgis_sip.h"
22 #include "qgis_core.h"
23 #include <QString>
24 #include <QVariant>
25 
27 class QgsLayerMetadata;
28 
37 {
38 
39  public:
40 
46  {
47 
51  ValidationResult( const QString &section, const QString &note, const QVariant &identifier = QVariant() )
52  : section( section )
53  , identifier( identifier )
54  , note( note )
55  {}
56 
58  QString section;
59 
66  QVariant identifier;
67 
69  QString note;
70  };
71 
72  virtual ~QgsAbstractMetadataBaseValidator() = default;
73 
81  virtual bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const = 0;
82 
83 };
84 
93 {
94 
95  public:
96 
100  QgsNativeMetadataBaseValidator() = default;
101 
102  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
103 
104 };
105 
106 
115 {
116 
117  public:
118 
122  QgsNativeMetadataValidator() = default;
123 
124  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
125 
126 };
127 
136 {
137 
138  public:
139 
144 
145  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
146 
147 };
148 
149 #endif // QGSLAYERMETADATAVALIDATOR_H
QString note
The reason behind the validation failure.
A validator for the native QGIS layer metadata schema definition.
A validator for the native base QGIS metadata schema definition.
ValidationResult(const QString &section, const QString &note, const QVariant &identifier=QVariant())
Constructor for ValidationResult.
Abstract base class for metadata validators.
A validator for the native QGIS project metadata schema definition.
Contains the parameters describing a metadata validation failure.
A structured metadata store for a map layer.
#define SIP_OUT
Definition: qgis_sip.h:51
An abstract base class for metadata stores.
QVariant identifier
Optional identifier for the failed metadata item.
QString section
Metadata section which failed the validation.