File indexing completed on 2025-01-05 04:01:16

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 #include "lottie_format.hpp"
0009 
0010 namespace glaxnimate::io::lottie {
0011 
0012 
0013 class TgsFormat : public LottieFormat
0014 {
0015     Q_OBJECT
0016 
0017 public:
0018     QString slug() const override { return "tgs"; }
0019     QString name() const override { return i18n("Telegram Animated Sticker"); }
0020     QStringList extensions() const override { return {"tgs"}; }
0021     bool can_save() const override { return true; }
0022     bool can_open() const override { return true; }
0023     std::unique_ptr<app::settings::SettingsGroup> save_settings(model::Composition*) const override { return {}; }
0024 
0025     void validate(model::Document* document, model::Composition* comp);
0026 
0027 private:
0028     bool on_save(QIODevice& file, const QString&,
0029                  model::Composition* comp, const QVariantMap&) override;
0030 
0031     bool on_open(QIODevice& file, const QString&,
0032                  model::Document* document, const QVariantMap&) override;
0033 
0034 
0035     static Autoreg<TgsFormat> autoreg;
0036 };
0037 
0038 } // namespace glaxnimate::io::lottie