00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "KoPathShapeFactory.h"
00021 #include "KoPathShape.h"
00022 #include "KoLineBorder.h"
00023
00024 #include <klocale.h>
00025
00026 KoPathShapeFactory::KoPathShapeFactory(QObject *parent, const QStringList&)
00027 : KoShapeFactory(parent, KoPathShapeId, i18n("A simple path shape"))
00028 {
00029 setToolTip("A simple path shape");
00030 setIcon("pathshape");
00031 }
00032
00033 KoShape * KoPathShapeFactory::createDefaultShape() {
00034 KoPathShape* path = new KoPathShape();
00035 path->moveTo( QPointF( 0, 10 ) );
00036 path->curveTo( QPointF( 0, 20 ), QPointF( 5, 20 ), QPointF( 5, 10 ) );
00037 path->curveTo( QPointF( 5, 0 ), QPointF( 10, 0 ), QPointF( 10, 10 ) );
00038 path->normalize();
00039 path->setBorder( new KoLineBorder( 1.0 ) );
00040 path->setShapeId(shapeId());
00041 return path;
00042 }
00043
00044 KoShape * KoPathShapeFactory::createShape(const KoProperties * params) const {
00045 Q_UNUSED(params);
00046 return new KoPathShape();
00047 }
00048