| 
									
										
										
										
											2017-04-27 20:24:53 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2013-06-17 15:58:26 -07:00
										 |  |  | #ifndef QTHELPER_H
 | 
					
						
							|  |  |  | #define QTHELPER_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QMultiMap>
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <stdint.h>
 | 
					
						
							| 
									
										
										
										
											2013-10-04 21:39:33 +03:00
										 |  |  | #include "dive.h"
 | 
					
						
							| 
									
										
										
										
											2013-11-26 15:44:18 -02:00
										 |  |  | #include "divelist.h"
 | 
					
						
							| 
									
										
										
										
											2013-10-08 22:25:02 -07:00
										 |  |  | #include <QTranslator>
 | 
					
						
							| 
									
										
										
										
											2015-02-26 14:39:42 +01:00
										 |  |  | #include <QDir>
 | 
					
						
							| 
									
										
										
										
											2013-10-08 22:25:02 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | // global pointers for our translation
 | 
					
						
							|  |  |  | extern QTranslator *qtTranslator, *ssrfTranslator; | 
					
						
							| 
									
										
										
										
											2013-06-17 15:58:26 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-04 21:39:33 +03:00
										 |  |  | QString weight_string(int weight_in_grams); | 
					
						
							| 
									
										
										
										
											2015-07-14 11:35:04 -07:00
										 |  |  | QString distance_string(int distanceInMeters); | 
					
						
							| 
									
										
										
										
											2014-06-02 18:13:50 -07:00
										 |  |  | bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed_out = 0); | 
					
						
							| 
									
										
										
										
											2015-02-14 17:50:48 -08:00
										 |  |  | extern "C" const char *printGPSCoords(int lat, int lon); | 
					
						
							| 
									
										
										
										
											2017-03-31 08:14:36 +02:00
										 |  |  | extern "C" const char *get_current_date(); | 
					
						
							| 
									
										
										
										
											2013-11-26 15:44:18 -02:00
										 |  |  | QList<int> getDivesInTrip(dive_trip_t *trip); | 
					
						
							| 
									
										
										
										
											2015-05-28 16:23:49 -03:00
										 |  |  | QString get_gas_string(struct gasmix gas); | 
					
						
							| 
									
										
										
										
											2016-07-06 22:40:28 +10:00
										 |  |  | QString get_divepoint_gas_string(struct dive *d, const divedatapoint& dp); | 
					
						
							| 
									
										
										
										
											2015-02-26 14:39:42 +01:00
										 |  |  | void read_hashes(); | 
					
						
							|  |  |  | void write_hashes(); | 
					
						
							|  |  |  | void updateHash(struct picture *picture); | 
					
						
							|  |  |  | QByteArray hashFile(const QString filename); | 
					
						
							| 
									
										
										
										
											2016-03-06 21:32:12 -03:00
										 |  |  | void learnImages(const QDir dir, int max_recursions); | 
					
						
							| 
									
										
										
										
											2015-03-02 16:17:51 +01:00
										 |  |  | void add_hash(const QString filename, QByteArray hash); | 
					
						
							| 
									
										
										
										
											2016-01-09 16:27:23 +01:00
										 |  |  | void hashPicture(struct picture *picture); | 
					
						
							| 
									
										
										
										
											2015-02-26 14:39:42 +01:00
										 |  |  | QString localFilePath(const QString originalFilename); | 
					
						
							| 
									
										
										
										
											2017-02-21 10:00:16 +01:00
										 |  |  | QString fileFromHash(const char *hash); | 
					
						
							| 
									
										
										
										
											2015-03-02 16:18:16 +01:00
										 |  |  | void learnHash(struct picture *picture, QByteArray hash); | 
					
						
							| 
									
										
										
										
											2015-09-17 16:56:58 +02:00
										 |  |  | extern "C" void cache_picture(struct picture *picture); | 
					
						
							| 
									
										
										
										
											2015-05-28 17:17:09 -03:00
										 |  |  | weight_t string_to_weight(const char *str); | 
					
						
							|  |  |  | depth_t string_to_depth(const char *str); | 
					
						
							|  |  |  | pressure_t string_to_pressure(const char *str); | 
					
						
							|  |  |  | volume_t string_to_volume(const char *str, pressure_t workp); | 
					
						
							|  |  |  | fraction_t string_to_fraction(const char *str); | 
					
						
							| 
									
										
										
										
											2015-06-01 13:09:45 -07:00
										 |  |  | int getCloudURL(QString &filename); | 
					
						
							| 
									
										
										
										
											2015-07-30 22:38:28 -03:00
										 |  |  | bool parseGpsText(const QString &gps_text, double *latitude, double *longitude); | 
					
						
							| 
									
										
										
										
											2015-08-22 07:05:13 -07:00
										 |  |  | QByteArray getCurrentAppState(); | 
					
						
							|  |  |  | void setCurrentAppState(QByteArray state); | 
					
						
							| 
									
										
										
										
											2015-08-19 23:12:30 +02:00
										 |  |  | extern "C" bool in_planner(); | 
					
						
							| 
									
										
										
										
											2017-01-07 03:01:14 +01:00
										 |  |  | extern "C" enum deco_mode decoMode(); | 
					
						
							| 
									
										
										
										
											2015-10-13 11:34:26 -07:00
										 |  |  | extern "C" void subsurface_mkdir(const char *dir); | 
					
						
							| 
									
										
										
										
											2015-11-14 10:43:37 -08:00
										 |  |  | void init_proxy(); | 
					
						
							| 
									
										
										
										
											2015-11-18 17:57:13 -08:00
										 |  |  | QString getUUID(); | 
					
						
							| 
									
										
										
										
											2017-05-05 21:13:46 +02:00
										 |  |  | QStringList imageExtensionFilters(); | 
					
						
							| 
									
										
										
										
											2017-05-07 09:41:27 +03:00
										 |  |  | char *intdup(int index); | 
					
						
							| 
									
										
										
										
											2017-05-07 13:41:09 +03:00
										 |  |  | extern "C" int parse_seabear_header(const char *filename, char **params, int pnr); | 
					
						
							| 
									
										
										
										
											2017-08-25 23:21:27 +02:00
										 |  |  | enum inertgas {N2, HE}; | 
					
						
							|  |  |  | extern "C" double cache_value(int tissue, int timestep, enum inertgas gas); | 
					
						
							|  |  |  | extern "C" void cache_insert(int tissue, int timestep, enum inertgas gas, double value); | 
					
						
							| 
									
										
										
										
											2017-11-22 20:42:33 +01:00
										 |  |  | extern "C" void lock_planner(); | 
					
						
							|  |  |  | extern "C" void unlock_planner(); | 
					
						
							| 
									
										
										
										
											2013-06-17 15:58:26 -07:00
										 |  |  | #endif // QTHELPER_H
 |