QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
validity
qgsabstractvaliditycheck.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsabstractvaliditycheck.h
3
--------------------------
4
begin : November 2018
5
copyright : (C) 2018 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
#ifndef QGSABSTRACTVALIDITYCHECK_H
16
#define QGSABSTRACTVALIDITYCHECK_H
17
18
#include "qgis_core.h"
19
#include "
qgis_sip.h
"
20
21
#include <QObject>
22
#include <QString>
23
24
class
QgsValidityCheckContext
;
25
class
QgsFeedback
;
26
38
class
CORE_EXPORT
QgsValidityCheckResult
39
{
40
public
:
42
enum
Type
43
{
44
Warning
,
45
Critical
,
46
};
47
49
QgsValidityCheckResult::Type
type
;
50
54
QString
title
;
55
60
QString
detailedDescription
;
61
65
QString
checkId
;
66
};
67
91
class
CORE_EXPORT
QgsAbstractValidityCheck
92
{
93
public
:
94
// *INDENT-OFF*
96
enum class
Type
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
(
QgsAbstractValidityCheck
,
Type
) : int
97
{
98
LayoutCheck
SIP_MONKEYPATCH_COMPAT_NAME
( TypeLayoutCheck ) = 0,
99
UserCheck
SIP_MONKEYPATCH_COMPAT_NAME
( TypeUserCheck ) = 10000,
100
};
101
// *INDENT-ON*
102
103
virtual
~QgsAbstractValidityCheck
() =
default
;
104
108
virtual
QgsAbstractValidityCheck
*
create
()
const
= 0
SIP_FACTORY
;
109
115
virtual
QString
id
()
const
= 0;
116
120
virtual
int
checkType
()
const
= 0;
121
136
virtual
bool
prepareCheck
(
const
QgsValidityCheckContext
*context,
QgsFeedback
*feedback )
137
{
138
Q_UNUSED( context )
139
Q_UNUSED( feedback )
140
return
true
;
141
}
142
155
virtual
QList< QgsValidityCheckResult >
runCheck
(
const
QgsValidityCheckContext
*context,
QgsFeedback
*feedback ) = 0;
156
};
157
158
#endif
// QGSABSTRACTVALIDITYCHECK_H
QgsAbstractValidityCheck
Abstract base class for individual validity checks.
Definition
qgsabstractvaliditycheck.h:92
QgsAbstractValidityCheck::prepareCheck
virtual bool prepareCheck(const QgsValidityCheckContext *context, QgsFeedback *feedback)
Prepares the check for execution, and returns true if the check can be run.
Definition
qgsabstractvaliditycheck.h:136
QgsAbstractValidityCheck::Type
Type
Check types.
Definition
qgsabstractvaliditycheck.h:97
QgsAbstractValidityCheck::id
virtual QString id() const =0
Returns the unique ID of the check.
QgsAbstractValidityCheck::checkType
virtual int checkType() const =0
Returns the type of the check.
QgsAbstractValidityCheck::create
virtual QgsAbstractValidityCheck * create() const =0
Creates a new instance of the check and returns it.
QgsAbstractValidityCheck::runCheck
virtual QList< QgsValidityCheckResult > runCheck(const QgsValidityCheckContext *context, QgsFeedback *feedback)=0
Runs the check and returns a list of results.
QgsAbstractValidityCheck::~QgsAbstractValidityCheck
virtual ~QgsAbstractValidityCheck()=default
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsValidityCheckContext
Base class for validity check contexts.
Definition
qgsvaliditycheckcontext.h:36
QgsValidityCheckResult
Represents an individual result from a validity check run by a QgsAbstractValidityCheck subclass.
Definition
qgsabstractvaliditycheck.h:39
QgsValidityCheckResult::type
QgsValidityCheckResult::Type type
Result type.
Definition
qgsabstractvaliditycheck.h:49
QgsValidityCheckResult::Type
Type
Result types.
Definition
qgsabstractvaliditycheck.h:43
QgsValidityCheckResult::Critical
@ Critical
Critical error - notify user of result and prevent operation from proceeding.
Definition
qgsabstractvaliditycheck.h:45
QgsValidityCheckResult::Warning
@ Warning
Warning only, allow operation to proceed but notify user of result.
Definition
qgsabstractvaliditycheck.h:44
QgsValidityCheckResult::checkId
QString checkId
ID of the check which generated the result.
Definition
qgsabstractvaliditycheck.h:65
QgsValidityCheckResult::detailedDescription
QString detailedDescription
Detailed description of the result (translated), giving users enough detail for them to resolve the e...
Definition
qgsabstractvaliditycheck.h:60
QgsValidityCheckResult::title
QString title
A short, translated string summarising the result.
Definition
qgsabstractvaliditycheck.h:54
qgis_sip.h
SIP_MONKEYPATCH_SCOPEENUM_UNNEST
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition
qgis_sip.h:270
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
SIP_MONKEYPATCH_COMPAT_NAME
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition
qgis_sip.h:272
Generated on
for QGIS API Documentation by
1.17.0