summaryrefslogtreecommitdiffstats
path: root/core/helpers.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-04 22:02:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-04 22:33:58 -0700
commit7be962bfc2879a72c32ff67518731347dcdff6de (patch)
treed05bf7ab234a448ee37a15b608e2b939f2285d07 /core/helpers.h
parent2d760a7bff71c46c5aeba37c40d236ea16eefea2 (diff)
downloadsubsurface-7be962bfc2879a72c32ff67518731347dcdff6de.tar.gz
Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/helpers.h')
-rw-r--r--core/helpers.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/core/helpers.h b/core/helpers.h
new file mode 100644
index 000000000..f88da015c
--- /dev/null
+++ b/core/helpers.h
@@ -0,0 +1,56 @@
+/*
+ * helpers.h
+ *
+ * header file for random helper functions of Subsurface
+ *
+ */
+#ifndef HELPERS_H
+#define HELPERS_H
+
+#include <QString>
+#include "dive.h"
+#include "qthelper.h"
+
+QString get_depth_string(depth_t depth, bool showunit = false, bool showdecimal = true);
+QString get_depth_string(int mm, bool showunit = false, bool showdecimal = true);
+QString get_depth_unit();
+QString get_weight_string(weight_t weight, bool showunit = false);
+QString get_weight_unit();
+QString get_cylinder_used_gas_string(cylinder_t *cyl, bool showunit = false);
+QString get_temperature_string(temperature_t temp, bool showunit = false);
+QString get_temp_unit();
+QString get_volume_string(volume_t volume, bool showunit = false);
+QString get_volume_unit();
+QString get_pressure_string(pressure_t pressure, bool showunit = false);
+QString get_pressure_unit();
+void set_default_dive_computer(const char *vendor, const char *product);
+void set_default_dive_computer_device(const char *name);
+void set_default_dive_computer_download_mode(int downloadMode);
+QString getSubsurfaceDataPath(QString folderToFind);
+QString getPrintingTemplatePathUser();
+QString getPrintingTemplatePathBundle();
+void copyPath(QString src, QString dst);
+extern const QString get_dc_nickname(const char *model, uint32_t deviceid);
+int gettimezoneoffset(timestamp_t when = 0);
+int parseLengthToMm(const QString &text);
+int parseTemperatureToMkelvin(const QString &text);
+int parseWeightToGrams(const QString &text);
+int parsePressureToMbar(const QString &text);
+int parseGasMixO2(const QString &text);
+int parseGasMixHE(const QString &text);
+QString get_dive_duration_string(timestamp_t when, QString hourText, QString minutesText);
+QString get_dive_date_string(timestamp_t when);
+QString get_short_dive_date_string(timestamp_t when);
+bool is_same_day (timestamp_t trip_when, timestamp_t dive_when);
+QString get_trip_date_string(timestamp_t when, int nr, bool getday);
+QString uiLanguage(QLocale *callerLoc);
+QLocale getLocale();
+void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsed);
+QString getUserAgent();
+
+#if defined __APPLE__
+#define TITLE_OR_TEXT(_t, _m) "", _t + "\n" + _m
+#else
+#define TITLE_OR_TEXT(_t, _m) _t, _m
+#endif
+#endif // HELPERS_H