QGIS API Documentation  3.17.0-Master (a035f434f4)
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
The class is used as a container of context for various read/write operations on other objects...
Base class for all map layer types.
Definition: qgsmaplayer.h:83
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
Base class for handling properties relating to a data provider&#39;s temporal capabilities.
#define SIP_END
Definition: qgis_sip.h:194
Base class for temporal property.
Base class for storage of map layer temporal properties.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177