QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsmeshtimesettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshtimesettings.h
3  ---------------------
4  begin : March 2019
5  copyright : (C) 2019 by Peter Petrik
6  email : zilolv 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 QGSMESHTIMESETTINGS_H
19 #define QGSMESHTIMESETTINGS_H
20 
21 #include <QDateTime>
22 #include <QDomDocument>
23 
24 #include "qgis_core.h"
25 #include "qgis.h"
26 #include "qgsreadwritecontext.h"
27 
35 class CORE_EXPORT QgsMeshTimeSettings
36 {
37  public:
41  QgsMeshTimeSettings( double relativeTimeOffsetHours, const QString &relativeTimeFormat );
43  QgsMeshTimeSettings( const QDateTime &absoluteTimeReferenceTime, const QString &absoluteTimeFormat );
44 
46  QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
48  void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
49 
51  bool useAbsoluteTime() const;
53  void setUseAbsoluteTime( bool useAbsoluteTime );
54 
56  double relativeTimeOffsetHours() const;
58  void setRelativeTimeOffsetHours( double relativeTimeOffsetHours );
59 
61  QString relativeTimeFormat() const;
63  void setRelativeTimeFormat( const QString &relativeTimeFormat );
64 
66  QDateTime absoluteTimeReferenceTime() const;
68  void setAbsoluteTimeReferenceTime( const QDateTime &absoluteTimeReferenceTime );
69 
71  QString absoluteTimeFormat() const;
73  void setAbsoluteTimeFormat( const QString &absoluteTimeFormat );
74 
75  private:
76  bool mUseAbsoluteTime = false;
77 
78  double mRelativeTimeOffsetHours = 0;
79  QString mRelativeTimeFormat = QStringLiteral( "d hh:mm:ss" );
80 
81  QDateTime mAbsoluteTimeReferenceTime;
82  QString mAbsoluteTimeFormat = QStringLiteral( "dd.MM.yyyy hh:mm:ss" );
83 };
84 
86 
87 #endif // QGSMESHTIMESETTINGS_H
The class is used as a container of context for various read/write operations on other objects...
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
Represents a mesh time settings for mesh datasets.