Krita Source Code Documentation
Loading...
Searching...
No Matches
CompositionsCheck.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 CompositionsCHECK_H
8#define CompositionsCHECK_H
9
11#include <KoID.h>
12#include <klocalizedstring.h>
13#include <kis_image.h>
14
16{
17public:
18
19 CompositionsCheck(const QString &id, Level level, const QString &customWarning = QString())
20 : KisExportCheckBase(id, level, customWarning)
21 {
22 if (customWarning.isEmpty()) {
23 m_warning = i18nc("image conversion warning", "The image contains <b>compositions</b>. The compositions will not be saved.");
24 }
25 }
26
27 bool checkNeeded(KisImageSP image) const override
28 {
29 return (image->compositions().size() > 0);
30 }
31
32 Level check(KisImageSP /*image*/) const override
33 {
34 return m_level;
35 }
36};
37
39{
40public:
41
45
47
48 KisExportCheckBase *create(KisExportCheckBase::Level level, const QString &customWarning) override
49 {
50 return new CompositionsCheck(id(), level, customWarning);
51 }
52
53 QString id() const override {
54 return "CompositionsCheck";
55 }
56};
57
58#endif // CompositionsCHECK_H
KisExportCheckBase * create(KisExportCheckBase::Level level, const QString &customWarning) override
QString id() const override
Level check(KisImageSP) const override
CompositionsCheck(const QString &id, Level level, const QString &customWarning=QString())
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
QList< KisLayerCompositionSP > compositions()