QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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.h"
22 #include "qgis_core.h"
23 
25 class QgsLayerMetadata;
26 
35 {
36 
37  public:
38 
44  {
45 
49  ValidationResult( const QString &section, const QString &note, const QVariant &identifier = QVariant() )
50  : section( section )
51  , identifier( identifier )
52  , note( note )
53  {}
54 
56  QString section;
57 
64  QVariant identifier;
65 
67  QString note;
68  };
69 
70  virtual ~QgsAbstractMetadataBaseValidator() = default;
71 
79  virtual bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const = 0;
80 
81 };
82 
91 {
92 
93  public:
94 
99 
100  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
101 
102 };
103 
104 
113 {
114 
115  public:
116 
120  QgsNativeMetadataValidator() = default;
121 
122  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
123 
124 };
125 
134 {
135 
136  public:
137 
142 
143  bool validate( const QgsAbstractMetadataBase *metadata, QList< QgsAbstractMetadataBaseValidator::ValidationResult > &results SIP_OUT ) const override;
144 
145 };
146 
147 #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.