diff options
author | jan Iversen <jan@casacondor.com> | 2019-11-20 18:09:44 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-03 21:30:39 -0800 |
commit | 4e690119ef38b54d59d87fde6420d796939e0804 (patch) | |
tree | fb8e2e169b8eb522113c587d7724e9c787d6175b /core/exportfuncs.h | |
parent | f59799803877cde9711a9e68768e99e7704ff7eb (diff) | |
download | subsurface-4e690119ef38b54d59d87fde6420d796939e0804.tar.gz |
core: add shared export functions (copy from desktop-widgets)
desktop-widgets/divelogexportdialog.* contains both the desktop
dialog as well as the "real" export functions.
Create a class to be shared between desktop and mobile
Copy the export functions 1-1 from divelogexportdialog.* of course
changing class names.
saveProfile is highly dependent on the UI, so the implementaion will
be done in each UI directory (desktop-widgets, mobile-widgets).
Remark this commit just add the copied functions, in order to secure
nothing is broken.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'core/exportfuncs.h')
-rw-r--r-- | core/exportfuncs.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/core/exportfuncs.h b/core/exportfuncs.h new file mode 100644 index 000000000..9f0a17909 --- /dev/null +++ b/core/exportfuncs.h @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef EXPORTFUNCS_H +#define EXPORTFUNCS_H + +#include <QObject> +#include <QFuture> +#include "dive.h" + +class exportFuncs: public QObject { + Q_OBJECT + +public: + static exportFuncs *instance(); + + void exportProfile(QString filename, const bool selected_only); + void export_TeX(const char *filename, const bool selected_only, bool plain); + void export_depths(const char *filename, const bool selected_only); + std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly); + void exportUsingStyleSheet(QString filename, bool doExport, int units, + QString stylesheet, bool anonymize); + QFuture<int> future; + + // prepareDivesForUploadDiveLog + // prepareDivesForUploadDiveShare + +private: + exportFuncs() {} + + // WARNING + // saveProfile uses the UI and are therefore different between + // Desktop (UI) and Mobile (QML) + // In order to solve this difference, the actual implementations + // are done in + // desktop-widgets/divelogexportdialog.cpp and + // mobile-widgets/qmlmanager.cpp + void saveProfile(const struct dive *dive, const QString filename); +}; + +#endif // EXPORT_FUNCS_H |