Krita Source Code Documentation
Loading...
Searching...
No Matches
AnimationCheck.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef AnimationCHECK_H
8#define AnimationCHECK_H
9
11#include <KoID.h>
12#include <klocalizedstring.h>
13#include <kis_image.h>
15#include <KoColorSpace.h>
16
18{
19public:
20
21 AnimationCheck(const QString &id, Level level, const QString &customWarning = QString())
22 : KisExportCheckBase(id, level, customWarning, true)
23 {
24 if (customWarning.isEmpty()) {
25 m_warning = i18nc("image conversion warning", "This image has <b>animated layers</b>. Animation cannot be saved to this format.");
26 }
27 }
28
29 bool checkNeeded(KisImageSP image) const override
30 {
31 return image->animationInterface()->hasAnimation();
32 }
33
34 Level check(KisImageSP /*image*/) const override
35 {
36 return m_level;
37 }
38};
39
41{
42public:
43
45
47
48 KisExportCheckBase *create(KisExportCheckBase::Level level, const QString &customWarning) override
49 {
50 return new AnimationCheck(id(), level, customWarning);
51 }
52
53 QString id() const override {
54 return "AnimationCheck";
55 }
56};
57
58#endif // AnimationCHECK_H
~AnimationCheckFactory() override
KisExportCheckBase * create(KisExportCheckBase::Level level, const QString &customWarning) override
QString id() const override
AnimationCheck(const QString &id, Level level, const QString &customWarning=QString())
Level check(KisImageSP) const override
bool checkNeeded(KisImageSP image) const override
The KisExportCheckBase class defines the interface of the individual checks of an export filter's cap...
virtual QString id() const
KisImageAnimationInterface * animationInterface() const