File indexing completed on 2024-04-28 15:39:06

0001 // SPDX-FileCopyrightText: 2020-2021 Tobias Leupold <tl at stonemx dot de>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef KGEOTAG_H
0006 #define KGEOTAG_H
0007 
0008 // Local includes
0009 #include "Coordinates.h"
0010 
0011 // Qt includes
0012 #include <QString>
0013 #include <QMetaType>
0014 #include <QHash>
0015 
0016 namespace KGeoTag
0017 {
0018 
0019 // Depth of the Marianna Trench minus some meters
0020 constexpr const double minimalAltitude = -12000.0;
0021 
0022 // Height of Mount Everest plus some meters
0023 constexpr const double maximalAltitude = 8900.0;
0024 
0025 // Earth radius according to the GRS 80 ellipsoid (radius of a sphere of equal area)
0026 constexpr const double earthRadius = 6371007.2;
0027 
0028 // 5 decimal places of degrees result in a precision of at worst about 1 m.
0029 // This should be by far enough for the present use-case.
0030 constexpr const int degreesPrecision = 5;
0031 
0032 // Same for 0,1 m altitude precision ;-)
0033 constexpr const int altitudePrecision = 1;
0034 
0035 enum SearchType {
0036     CombinedMatchSearch,
0037     ExactMatchSearch,
0038     InterpolatedMatchSearch
0039 };
0040 
0041 enum MatchType {
0042     NotMatched,
0043     ExactMatch,
0044     InterpolatedMatch,
0045     ManuallySet
0046 };
0047 
0048 enum ImagesListType {
0049     UnAssignedImages,
0050     AssignedImages,
0051     AllImages
0052 };
0053 
0054 const QString backupSuffix = QStringLiteral("orig");
0055 
0056 const auto SourceImagesListMimeType = QStringLiteral("application/x-kgeotag-source_images_list");
0057 const QHash<ImagesListType, QByteArray> SourceImagesList {
0058     { ImagesListType::UnAssignedImages, QByteArray("UnAssignedImages") },
0059     { ImagesListType::AssignedImages,   QByteArray("AssignedImages") },
0060     { ImagesListType::AllImages,        QByteArray("AllImages") }
0061 };
0062 
0063 enum CustomDataRoles {
0064     PathRole = Qt::UserRole,
0065     DateRole,
0066     CoordinatesRole,
0067     ThumbnailRole,
0068     PreviewRole,
0069     MatchTypeRole,
0070     ChangedRole
0071 };
0072 
0073 enum DropTarget {
0074     DroppedOnImageList,
0075     DroppedOnMap,
0076     DroppedOnTrackList
0077 };
0078 
0079 enum FileType {
0080     UnsupportedFile,
0081     ImageFile,
0082     GeoDataFile
0083 };
0084 
0085 }
0086 
0087 Q_DECLARE_METATYPE(KGeoTag::MatchType)
0088 
0089 #endif // KGEOTAG_H