File indexing completed on 2025-01-05 04:01:19
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "io/base.hpp" 0010 #include "io/io_registry.hpp" 0011 0012 namespace glaxnimate::io::svg { 0013 0014 0015 class SvgFormat : public ImportExport 0016 { 0017 Q_OBJECT 0018 0019 public: 0020 QString slug() const override { return "svg"; } 0021 QString name() const override { return i18n("SVG"); } 0022 QStringList extensions() const override { return {"svg", "svgz"}; } 0023 bool can_save() const override { return true; } 0024 bool can_open() const override { return true; } 0025 std::unique_ptr<app::settings::SettingsGroup> save_settings(model::Composition*) const override; 0026 0027 protected: 0028 bool on_open(QIODevice& file, const QString&, model::Document* document, const QVariantMap&) override; 0029 bool on_save(QIODevice & file, const QString & filename, model::Composition* comp, const QVariantMap & setting_values) override; 0030 0031 private: 0032 static Autoreg<SvgFormat> autoreg; 0033 }; 0034 0035 0036 } // namespace glaxnimate::io::svg 0037