Krita Source Code Documentation
Loading...
Searching...
No Matches
MultiLayerCheck.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 MultiLayerCheck_H
8#define MultiLayerCheck_H
9
11#include <KoID.h>
12#include <klocalizedstring.h>
13#include <kis_image.h>
14#include <kis_group_layer.h>
15
17{
18public:
19
20 MultiLayerCheck(const QString &id, Level level, const QString &customWarning = QString())
21 : KisExportCheckBase(id, level, customWarning)
22 {
23 if (customWarning.isEmpty()) {
24 m_warning = i18nc("image conversion warning", "The image has <b>more than one layer or a mask or an active selection</b>. Only the flattened image will be saved.");
25 }
26 }
27
28 bool checkNeeded(KisImageSP image) const override
29 {
30 return (image->rootLayer()->childCount() > 1);
31 }
32
33 Level check(KisImageSP /*image*/) const override
34 {
35 return m_level;
36 }
37
38};
39
41{
42public:
43
45
47
48 KisExportCheckBase *create(KisExportCheckBase::Level level, const QString &customWarning) override
49 {
50 return new MultiLayerCheck(id(), level, customWarning);
51 }
52
53 QString id() const override {
54 return "MultiLayerCheck";
55 }
56};
57
58#endif // MultiLayerCheck_H
The KisExportCheckBase class defines the interface of the individual checks of an export filter's cap...
virtual QString id() const
KisGroupLayerSP rootLayer() const
~MultiLayerCheckFactory() override
KisExportCheckBase * create(KisExportCheckBase::Level level, const QString &customWarning) override
QString id() const override
MultiLayerCheck(const QString &id, Level level, const QString &customWarning=QString())
Level check(KisImageSP) const override
bool checkNeeded(KisImageSP image) const override
quint32 childCount() const
Definition kis_node.cpp:414