20#include <klocalizedstring.h>
30 elementNames <<
"regular-polygon" <<
"custom-shape";
37 t.
name = i18n(
"Star");
44 v.setValue(QColor(Qt::yellow));
51 t.
name = i18n(
"Flower");
61 v.setValue(QColor(Qt::magenta));
68 t.
name = i18n(
"Pentagon");
77 v.setValue(QColor(Qt::blue));
84 t.
name = i18n(
"Hexagon");
93 v.setValue(QColor(Qt::blue));
135 if (e.localName() ==
"regular-polygon" && e.namespaceURI() ==
KoXmlNS::draw) {
138 return (e.localName() ==
"custom-shape" && e.namespaceURI() ==
KoXmlNS::draw
139 && e.attributeNS(
KoXmlNS::draw,
"engine",
"") ==
"calligra:star");
A simple solid color shape background.
int intProperty(const QString &name, int defaultValue=0) const
bool boolProperty(const QString &name, bool defaultValue=false) const
void setProperty(const QString &name, const QVariant &value)
bool property(const QString &name, QVariant &value) const
qreal doubleProperty(const QString &name, qreal defaultValue=0.0) const
void addTemplate(const KoShapeTemplate ¶ms)
void setToolTip(const QString &tooltip)
void setLoadingPriority(int priority)
void setIconName(const char *iconName)
void setXmlElementNames(const QString &nameSpace, const QStringList &elementNames)
virtual void setStroke(KoShapeStrokeModelSP stroke)
virtual void setBackground(QSharedPointer< KoShapeBackground > background)
void setShapeId(const QString &id)
static const QString draw
StarShapeFactory()
constructor
bool supports(const QDomElement &e, KoShapeLoadingContext &context) const override
QList< KoShapeConfigWidgetBase * > createShapeOptionPanels() override
KoShape * createDefaultShape(KoDocumentResourceManager *documentResources=0) const override
KoShape * createShape(const KoProperties *params, KoDocumentResourceManager *documentResources=0) const override
void setBaseRadius(qreal baseRadius)
void setCornerCount(uint cornerCount)
void setTipRadius(qreal tipRadius)
void setTipRoundness(qreal tipRoundness)
void setBaseRoundness(qreal baseRoundness)
void setConvex(bool convex)
#define koIconNameCStr(name)
QSharedPointer< T > toQShared(T *ptr)
QString iconName
Icon name.
QString family
The family of the shape (possible values are: "funny","arrow")
QString id
The id of the shape.
QString toolTip
The tooltip text for the template.
QString name
The name to be shown for this template.
const KoProperties * properties
QString templateId
The id of this particular template - only has to be unique with the shape.