Krita Source Code Documentation
Loading...
Searching...
No Matches
KisExportCheckBase.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef KISEXPORTCHECKBASE_H
7#define KISEXPORTCHECKBASE_H
8
9#include <QString>
10
11#include <kis_types.h>
12
13#include "kritaimpex_export.h"
14
19class KRITAIMPEX_EXPORT KisExportCheckBase
20{
21public:
22
25 enum Level {
26 SUPPORTED, //< The filter fully supports this
27 PARTIALLY, //< The filter can handle this, but the user needs to be warned about possible degradation
28 UNSUPPORTED //< This cannot be saved using this filter
29 };
30
36 KisExportCheckBase(const QString &id, Level level, const QString &customWarning = QString(), bool perLayerCheck = false);
37
38 virtual ~KisExportCheckBase();
39
41 virtual QString id() const;
42
44 virtual bool checkNeeded(KisImageSP image) const = 0;
45
47 virtual bool perLayerCheck() const;
48
50 virtual Level check(KisImageSP image) const = 0;
51
53 QString warning() const;
54
55protected:
56
57 QString m_id;
58 Level m_level {UNSUPPORTED};
59 QString m_warning;
60 bool m_perLayerCheck {false};
61
62};
63
64class KRITAIMPEX_EXPORT KisExportCheckFactory
65{
66public:
67 virtual KisExportCheckBase *create(KisExportCheckBase::Level level, const QString &customWarning = QString()) = 0;
69 virtual QString id() const = 0;
70};
71
72
73#endif
The KisExportCheckBase class defines the interface of the individual checks of an export filter's cap...
virtual bool checkNeeded(KisImageSP image) const =0
virtual Level check(KisImageSP image) const =0
virtual QString id() const =0
virtual KisExportCheckBase * create(KisExportCheckBase::Level level, const QString &customWarning=QString())=0