File indexing completed on 2024-04-28 03:50:19

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Daniel Marth <danielmarth@gmx.at>
0004 //
0005 
0006 #ifndef OPENCACHINGCACHE_H
0007 #define OPENCACHINGCACHE_H
0008 
0009 #include "OpenCachingCacheLog.h"
0010 #include "OpenCachingCacheDescription.h"
0011 
0012 #include <QString>
0013 #include <QDateTime>
0014 
0015 namespace Marble
0016 {
0017 
0018 /**
0019  * Contains all information about a cache, including logs and descriptions in all
0020  * available languages.
0021  */
0022 class OpenCachingCache
0023 {
0024 public:
0025     explicit OpenCachingCache( const QHash<QString, QVariant>& properties = QHash<QString, QVariant>() );
0026 
0027     void setId( unsigned long long id );
0028 
0029     unsigned long long id() const;
0030 
0031     void setDateHidden( const QDateTime& dateHidden );
0032 
0033     const QDateTime& dateHidden() const;
0034 
0035     void setDateCreated( const QDateTime& dateCreated );
0036 
0037     const QDateTime& dateCreated() const;
0038 
0039     void setDateLastModified( const QDateTime& dateLastModified );
0040 
0041     const QDateTime& dateLastModified() const;
0042 
0043     void setUserName( const QString& userName );
0044 
0045     const QString& userName() const;
0046 
0047     void setCacheName( const QString& cacheName );
0048 
0049     const QString& cacheName() const;
0050 
0051     void setCacheType( const QString& cacheType );
0052 
0053     const QString& cacheType() const;
0054 
0055     void setStatus( const QString& status );
0056 
0057     const QString& status() const;
0058 
0059     void setCountry( const QString& country );
0060 
0061     const QString& country() const;
0062 
0063     void setSizeString( const QString& size );
0064 
0065     const QString& sizeString() const;
0066 
0067     void setDifficulty( qreal difficulty );
0068 
0069     qreal difficulty() const;
0070 
0071     void setTerrain( qreal terrain );
0072 
0073     qreal terrain() const;
0074 
0075     void setLongitude( qreal longitude );
0076 
0077     qreal longitude() const;
0078 
0079     void setLatitude( qreal latitude );
0080 
0081     qreal latitude() const;
0082 
0083     void setDescription( const QHash<QString, OpenCachingCacheDescription>& description );
0084 
0085     const QHash<QString, OpenCachingCacheDescription>& description() const;
0086 
0087     void setLog( const OpenCachingCacheLog& log );
0088 
0089     const OpenCachingCacheLog& log() const;
0090 
0091 private:
0092     void updateTooltip();
0093 
0094     unsigned long long m_id;             ///< Unique ID of the cache.
0095 
0096     QDateTime m_dateHidden;              ///< Date the cache was hidden.
0097 
0098     QDateTime m_dateCreated;             ///< Date the cache was created.
0099 
0100     QDateTime m_dateLastModified;        ///< Date the cache was last modified.
0101 
0102     QString m_userName;                  ///< Name of the user that hid the cache.
0103 
0104     QString m_cacheName;                 ///< Name of the cache.
0105 
0106     QString m_cacheType;                 ///< Type of the cache. @todo Possible types?
0107 
0108     QString m_status;                    ///< Status of the cache. @todo Possible states?
0109 
0110     QString m_country;                   ///< Country in which the cache is located.
0111 
0112     QString m_sizeString;                ///< Size of the cache as a string.
0113 
0114     qreal m_difficulty;                  ///< Difficulty of the cache from 1 to 5.
0115 
0116     qreal m_terrain;                     ///< @todo ?
0117 
0118     qreal m_longitude;                   ///< Longitude of the cache.
0119 
0120     qreal m_latitude;                    ///< Latitude of the cache.
0121 
0122     QHash<QString, OpenCachingCacheDescription> m_description;  ///< Descriptions in all available languages. Languages are keys of the map.
0123 
0124     OpenCachingCacheLog m_log;           ///< Log entries of the cache.
0125 };
0126 
0127 }
0128 #endif // OPENCACHINGCACHE_H