2017-04-27 18:24:53 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-02-11 19:22:00 +00:00
|
|
|
#ifndef DIVESITE_H
|
|
|
|
#define DIVESITE_H
|
|
|
|
|
2020-05-01 11:43:52 +00:00
|
|
|
#include "divelist.h"
|
2024-05-11 09:47:45 +00:00
|
|
|
#include "taxonomy.h"
|
|
|
|
#include "units.h"
|
2015-02-11 19:22:00 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
struct dive_site
|
|
|
|
{
|
2024-05-04 11:39:04 +00:00
|
|
|
uint32_t uuid = 0;
|
2024-05-04 15:18:08 +00:00
|
|
|
std::string name;
|
2024-05-04 12:41:04 +00:00
|
|
|
std::vector<dive *> dives;
|
2024-05-04 17:15:47 +00:00
|
|
|
location_t location;
|
2024-05-04 15:18:08 +00:00
|
|
|
std::string description;
|
|
|
|
std::string notes;
|
2024-05-04 11:39:04 +00:00
|
|
|
taxonomy_data taxonomy;
|
2024-05-11 13:01:37 +00:00
|
|
|
|
2024-05-04 11:39:04 +00:00
|
|
|
dive_site();
|
2024-05-04 15:18:08 +00:00
|
|
|
dive_site(const std::string &name);
|
2024-05-12 20:30:15 +00:00
|
|
|
dive_site(const std::string &name, const location_t loc);
|
2024-05-11 09:47:45 +00:00
|
|
|
dive_site(uint32_t uuid);
|
2024-05-04 11:39:04 +00:00
|
|
|
~dive_site();
|
2024-05-11 13:01:37 +00:00
|
|
|
|
|
|
|
size_t nr_of_dives() const;
|
|
|
|
bool is_selected() const;
|
|
|
|
bool is_empty() const;
|
2024-06-30 15:38:36 +00:00
|
|
|
bool has_gps_location() const;
|
2024-05-11 13:01:37 +00:00
|
|
|
void merge(struct dive_site &b); // Note: b is consumed
|
|
|
|
void add_dive(struct dive *d);
|
2015-02-11 19:22:00 +00:00
|
|
|
};
|
|
|
|
|
2019-03-04 22:20:29 +00:00
|
|
|
struct dive_site *unregister_dive_from_dive_site(struct dive *d);
|
2024-06-07 08:25:09 +00:00
|
|
|
int divesite_comp_uuid(const dive_site &ds1, const dive_site &ds2);
|
2015-10-07 22:34:02 +00:00
|
|
|
|
2018-10-28 20:16:42 +00:00
|
|
|
/* Make pointer-to-dive_site a "Qt metatype" so that we can pass it through QVariants */
|
2024-06-07 08:25:09 +00:00
|
|
|
#include <QObject>
|
2018-10-28 20:16:42 +00:00
|
|
|
Q_DECLARE_METATYPE(dive_site *);
|
|
|
|
|
2015-02-11 19:22:00 +00:00
|
|
|
#endif // DIVESITE_H
|