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

#include <ShapeLayerTypeCheck.h>

+ Inheritance diagram for ShapeLayerTypeCheck:

Public Member Functions

Level check (KisImageSP) const override
 
bool checkNeeded (KisImageSP image) const override
 
 ShapeLayerTypeCheck (const QString &ShapeId, const QString &PathShapeId, 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_pathShapeId
 
QString m_shapeId
 

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 106 of file ShapeLayerTypeCheck.h.

Constructor & Destructor Documentation

◆ ShapeLayerTypeCheck()

ShapeLayerTypeCheck::ShapeLayerTypeCheck ( const QString & ShapeId,
const QString & PathShapeId,
const QString & id,
Level level,
const QString & customWarning = QString() )
inline

Definition at line 110 of file ShapeLayerTypeCheck.h.

111 : KisExportCheckBase(id, level, customWarning)
112 , m_shapeId(ShapeId)
113 , m_pathShapeId(PathShapeId)
114 {
115 if (customWarning.isEmpty()) {
116 if (m_pathShapeId.isEmpty()) {
117 QString name = m_shapeId;
118 m_warning = i18nc("image conversion warning", "The image contains a Vector Layer with Shapes of type <b>%1</b>, which is not supported, these will not be saved.", name);
119 } else {
120 m_warning = i18nc("image conversion warning", "The image contains a Vector Layer with Shapes of type <b>%1</b>, which is not supported, these will be saved as paths", m_pathShapeId);
121 }
122 }
123 }
KisExportCheckBase(const QString &id, Level level, const QString &customWarning=QString(), bool perLayerCheck=false)
KisExportCheckBase.
const char * name(StandardAction id)

References m_pathShapeId, m_shapeId, and KisExportCheckBase::m_warning.

Member Function Documentation

◆ check()

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

Implements KisExportCheckBase.

Definition at line 132 of file ShapeLayerTypeCheck.h.

133 {
134 return m_level;
135 }

References KisExportCheckBase::m_level.

◆ checkNeeded()

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

Implements KisExportCheckBase.

Definition at line 125 of file ShapeLayerTypeCheck.h.

126 {
128 image->rootLayer()->accept(v);
129 return (v.count() > 0);
130 }
qreal v
KisGroupLayerSP rootLayer() const
bool accept(KisNodeVisitor &v) override

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

Member Data Documentation

◆ m_pathShapeId

QString ShapeLayerTypeCheck::m_pathShapeId

Definition at line 138 of file ShapeLayerTypeCheck.h.

◆ m_shapeId

QString ShapeLayerTypeCheck::m_shapeId

Definition at line 137 of file ShapeLayerTypeCheck.h.


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