QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsvaliditycheckcontext.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvaliditycheckcontext.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 QGSVALIDITYCHECKCONTEXT_H
16 #define QGSVALIDITYCHECKCONTEXT_H
17 
18 #include "qgis_core.h"
19 #include "qgis_sip.h"
20 
21 class QgsLayout;
22 
35 class CORE_EXPORT QgsValidityCheckContext
36 {
37 
38 #ifdef SIP_RUN
40  if ( dynamic_cast<QgsLayoutValidityCheckContext *>( sipCpp ) != NULL )
41  sipType = sipType_QgsLayoutValidityCheckContext;
42  else
43  sipType = 0;
44  SIP_END
45 #endif
46 
47  public:
48 
51  {
52  TypeLayoutContext = 1,
53  TypeUserContext = 10001,
54  };
55 
59  virtual int type() const = 0;
60 
61  virtual ~QgsValidityCheckContext() = default;
62 
63 };
64 
76 {
77  public:
78 
83  : layout( layout )
84  {}
85 
86  int type() const override { return TypeLayoutContext; }
87 
91  QgsLayout *layout = nullptr;
92 
93 };
94 #endif // QGSVALIDITYCHECKCONTEXT_H
QgsValidityCheckContext::type
virtual int type() const =0
Returns the context type.
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
QgsValidityCheckContext
Base class for validity check contexts.
Definition: qgsvaliditycheckcontext.h:36
qgis_sip.h
QgsLayoutValidityCheckContext::type
int type() const override
Returns the context type.
Definition: qgsvaliditycheckcontext.h:86
QgsValidityCheckContext::ContextType
ContextType
Available check context types.
Definition: qgsvaliditycheckcontext.h:51
QgsLayoutValidityCheckContext
Validity check context for print layout validation.
Definition: qgsvaliditycheckcontext.h:76
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:50
QgsValidityCheckContext::TypeLayoutContext
@ TypeLayoutContext
Layout context, see QgsLayoutValidityCheckContext.
Definition: qgsvaliditycheckcontext.h:52
QgsValidityCheckContext::~QgsValidityCheckContext
virtual ~QgsValidityCheckContext()=default
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
QgsLayoutValidityCheckContext::QgsLayoutValidityCheckContext
QgsLayoutValidityCheckContext(QgsLayout *layout)
Constructor for QgsLayoutValidityCheckContext for the specified layout.
Definition: qgsvaliditycheckcontext.h:82