QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsmaplayertemporalproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayertemporalproperties.h
3  ---------------
4  begin : February 2020
5  copyright : (C) 2020 by Samweli Mwakisambwe
6  email : samweli at kartoza 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 
19 #ifndef QGSMAPLAYERTEMPORALPROPERTIES_H
20 #define QGSMAPLAYERTEMPORALPROPERTIES_H
21 
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 #include "qgstemporalproperty.h"
25 #include "qgsreadwritecontext.h"
26 #include "qgsrange.h"
27 
28 #include <QDomElement>
29 
31 
43 {
44 #ifdef SIP_RUN
48 #endif
49 
50  Q_OBJECT
51 
52 #ifdef SIP_RUN
54  if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
55  {
56  sipType = sipType_QgsRasterLayerTemporalProperties;
57  }
58  else if ( qobject_cast<QgsMeshLayerTemporalProperties *>( sipCpp ) )
59  {
60  sipType = sipType_QgsMeshLayerTemporalProperties;
61  }
62  else if ( qobject_cast<QgsVectorLayerTemporalProperties *>( sipCpp ) )
63  {
64  sipType = sipType_QgsVectorLayerTemporalProperties;
65  }
66  else
67  {
68  sipType = 0;
69  }
70  SIP_END
71 #endif
72 
73  public:
74 
80  QgsMapLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS, bool enabled = false );
81 
87  virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
88 
94  virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
95 
99  virtual bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const;
100 
105  virtual void setDefaultsFromDataProviderTemporalCapabilities( const QgsDataProviderTemporalCapabilities *capabilities ) = 0;
106 
107 #ifndef SIP_RUN
108 // sip gets confused with this, refuses to compile
109 
118  virtual QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const;
119 #endif
120 };
121 
122 #endif // QGSMAPLAYERTEMPORALPROPERTIES_H
qgstemporalproperty.h
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
qgsreadwritecontext.h
qgsrange.h
QgsDataProviderTemporalCapabilities
Definition: qgsdataprovidertemporalcapabilities.h:33
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
qgsvectorlayertemporalproperties.h
qgis_sip.h
QgsMapLayerTemporalProperties
Definition: qgsmaplayertemporalproperties.h:42
QgsTemporalProperty
Definition: qgstemporalproperty.h:35
QgsMapLayer
Definition: qgsmaplayer.h:81
qgsrasterlayertemporalproperties.h
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
qgsmeshlayertemporalproperties.h