digiKam
inatutils.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2021-03-20
7  * Description : a tool to export images to iNaturalist web service
8  *
9  * Copyright (C) 2021 by Joerg Lohse <joergmlpts at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_INAT_UTILS_H
24 #define DIGIKAM_INAT_UTILS_H
25 
26 // Qt includes
27 
28 #include <QString>
29 #include <QLocale>
30 #include <QPair>
31 #include <QHttpMultiPart>
32 
34 {
35 
36 extern const QLocale locale;
37 extern const bool isEnglish;
38 
42 extern const double meterInFeet;
43 extern const double meterInMiles;
44 
48 typedef QPair<QString, QString> Parameter;
49 extern QHttpMultiPart* getMultiPart(const QList<Parameter>& parameters,
50  const QString& imageName,
51  const QString& imageNameArg,
52  const QString& imagePath);
53 
57 extern double distanceBetween(double latitude1, double longitude1,
58  double latitude2, double longitude2);
59 
63 extern QString localizedLocation(double latitude, double longitude,
64  int precision);
65 
69 extern QString localizedTaxonomicRank(const QString& rank);
70 
74 extern QString localizedDistance(double distMeters, char format, int precision);
75 
79 extern QString localizedTimeDifference(quint64 diffSeconds);
80 
81 } // namespace DigikamGenericINatPlugin
82 
83 #endif // DIGIKAM_INAT_UTILS_H
Definition: piwigotalker.h:48
Definition: inatbrowserdlg.cpp:64
QString localizedDistance(double distMeters, char format, int precision)
Definition: inatutils.cpp:258
QHttpMultiPart * getMultiPart(const QList< Parameter > &parameters, const QString &imageName, const QString &imageNameArg, const QString &imagePath)
Definition: inatutils.cpp:55
QPair< QString, QString > Parameter
Definition: inatutils.h:48
const double meterInFeet
Definition: inatutils.cpp:50
double distanceBetween(double latitude1, double longitude1, double latitude2, double longitude2)
Definition: inatutils.cpp:107
const double meterInMiles
Definition: inatutils.cpp:51
QString localizedTaxonomicRank(const QString &rank)
Definition: inatutils.cpp:123
QString localizedTimeDifference(quint64 diffSeconds)
Definition: inatutils.cpp:293
const bool isEnglish
Definition: inatutils.cpp:46
const QLocale locale
Definition: inatutils.cpp:45
QString localizedLocation(double latitude, double longitude, int precision)
Definition: inatutils.cpp:251