Krita Source Code Documentation
Loading...
Searching...
No Matches
NodeTypeCheck Class Reference

#include <NodeTypeCheck.h>

+ Inheritance diagram for NodeTypeCheck:

Public Member Functions

Level check (KisImageSP) const override
 
bool checkNeeded (KisImageSP image) const override
 
 NodeTypeCheck (const QString &nodeType, const QString &description, const QString &id, Level level, const QString &customWarning=QString())
 
- Public Member Functions inherited from KisExportCheckBase
virtual QString id () const
 
 KisExportCheckBase (const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
 KisExportCheckBase.
 
virtual bool perLayerCheck () const
 
QString warning () const
 
virtual ~KisExportCheckBase ()
 

Public Attributes

QString m_nodeType
 

Additional Inherited Members

- Public Types inherited from KisExportCheckBase
enum  Level { SUPPORTED , PARTIALLY , UNSUPPORTED }
 
- Protected Attributes inherited from KisExportCheckBase
QString m_id
 
Level m_level {UNSUPPORTED}
 
bool m_perLayerCheck {false}
 
QString m_warning
 

Detailed Description

Definition at line 16 of file NodeTypeCheck.h.

Constructor & Destructor Documentation

◆ NodeTypeCheck()

NodeTypeCheck::NodeTypeCheck ( const QString & nodeType,
const QString & description,
const QString & id,
Level level,
const QString & customWarning = QString() )
inline

Definition at line 20 of file NodeTypeCheck.h.

21 : KisExportCheckBase(id, level, customWarning, true)
23 {
24 if (customWarning.isEmpty()) {
25 m_warning = i18nc("image conversion warning", "The image contains layers of unsupported type <b>%1</b>. Only the rendered result will be saved.", description);
26 }
27 }
char nodeType(const KoPathPoint *point)
KisExportCheckBase(const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
KisExportCheckBase.
QString m_nodeType

References KisExportCheckBase::m_warning.

Member Function Documentation

◆ check()

Level NodeTypeCheck::check ( KisImageSP image) const
inlineoverridevirtual
Returns
the level of support for this feature

Implements KisExportCheckBase.

Definition at line 45 of file NodeTypeCheck.h.

46 {
47 return m_level;
48 }

References KisExportCheckBase::m_level.

◆ checkNeeded()

bool NodeTypeCheck::checkNeeded ( KisImageSP image) const
inlineoverridevirtual
Returns
whether the image uses this feature

Implements KisExportCheckBase.

Definition at line 29 of file NodeTypeCheck.h.

30 {
31 QStringList nodetypes = QStringList() << m_nodeType;
32 KoProperties props;
33 KisCountVisitor v(nodetypes, props);
34 image->rootLayer()->accept(v);
35
36 // There is always one group layer, the root layer.
37 if (m_nodeType == "KisGroupLayer") {
38 return (v.count() > 1);
39 }
40 else {
41 return (v.count() > 0);
42 }
43 }
qreal v
QList< QString > QStringList
KisGroupLayerSP rootLayer() const
bool accept(KisNodeVisitor &v) override

References KisGroupLayer::accept(), m_nodeType, KisImage::rootLayer(), and v.

Member Data Documentation

◆ m_nodeType

QString NodeTypeCheck::m_nodeType

Definition at line 50 of file NodeTypeCheck.h.


The documentation for this class was generated from the following file: