summaryrefslogtreecommitdiffstats
path: root/src/io/file-export-cmd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/file-export-cmd.h')
-rw-r--r--src/io/file-export-cmd.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/io/file-export-cmd.h b/src/io/file-export-cmd.h
new file mode 100644
index 0000000..6d63ccb
--- /dev/null
+++ b/src/io/file-export-cmd.h
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * File export from the command line. This code use to be in main.cpp. It should be
+ * replaced by shared code (Gio::Actions?) for export from the file dialog.
+ *
+ * Copyright (C) 2018 Tavmjong Bah
+ *
+ * The contents of this file may be used under the GNU General Public License Version 2 or later.
+ *
+ */
+
+#ifndef INK_FILE_EXPORT_CMD_H
+#define INK_FILE_EXPORT_CMD_H
+
+#include <iostream>
+#include <gtkmm.h>
+
+class SPDocument;
+
+class InkFileExportCmd {
+
+public:
+ InkFileExportCmd();
+
+ void do_export(SPDocument* doc, std::string filename_in="");
+
+private:
+
+ guint32 get_bgcolor(SPDocument *doc);
+ std::string get_filename_out(std::string filename_in="", std::string object_id="");
+ int do_export_svg( SPDocument* doc, std::string filename_in);
+ int do_export_png( SPDocument* doc, std::string filename_in);
+ int do_export_ps_pdf(SPDocument* doc, std::string filename_in, std::string mime_type);
+ int do_export_win_metafile(SPDocument* doc, std::string filename_in, std::string mime_type);
+
+ Glib::ustring export_type_current;
+
+public:
+ // Should be private, but this is just temporary code (I hope!).
+
+ // One-to-one correspondence with command line options
+ std::string export_filename; // Only if one file is processed!
+
+ Glib::ustring export_type;
+ bool export_overwrite;
+
+ Glib::ustring export_area;
+ bool export_area_drawing;
+ bool export_area_page;
+ int export_margin;
+ bool export_area_snap;
+ int export_width;
+ int export_height;
+
+ double export_dpi;
+ bool export_ignore_filters;
+ bool export_text_to_path;
+ int export_ps_level;
+ Glib::ustring export_pdf_level;
+ bool export_latex;
+ Glib::ustring export_id;
+ bool export_id_only;
+ bool export_use_hints;
+ Glib::ustring export_background;
+ double export_background_opacity;
+ bool export_plain_svg;
+};
+
+#endif // INK_FILE_EXPORT_CMD_H
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :