1 /***************************************************************************
2  *                                                                         *
3  *   copyright : (C) 2007 The University of Toronto                        *
4  *                   netterfield@astro.utoronto.ca                         *
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  ***************************************************************************/
12 
13 #ifndef ELLIPSEITEM_H
14 #define ELLIPSEITEM_H
15 
16 #include "viewitem.h"
17 #include "graphicsfactory.h"
18 
19 namespace Kst {
20 
21 class EllipseItem : public ViewItem
22 {
23   Q_OBJECT
24   public:
25     explicit EllipseItem(View *parent);
26     virtual ~EllipseItem();
27 
defaultsGroupName()28     const QString defaultsGroupName() const {return EllipseItem::staticDefaultsGroupName();}
staticDefaultsGroupName()29     static QString staticDefaultsGroupName() { return QString("ellipse");}
30 
31     // for view item dialogs
hasStroke()32     virtual bool hasStroke() const {return true;}
hasBrush()33     virtual bool hasBrush() const {return true;}
34 
35     virtual void save(QXmlStreamWriter &xml);
36     virtual QPainterPath itemShape() const;
37     virtual void paint(QPainter *painter);
38 };
39 
40 class CreateEllipseCommand : public CreateCommand
41 {
42   public:
CreateEllipseCommand()43     CreateEllipseCommand() : CreateCommand(QObject::tr("Create Ellipse")) {}
CreateEllipseCommand(View * view)44     CreateEllipseCommand(View *view) : CreateCommand(view, QObject::tr("Create Ellipse")) {}
~CreateEllipseCommand()45     virtual ~CreateEllipseCommand() {}
46     virtual void createItem();
47 };
48 
49 class EllipseItemFactory : public GraphicsFactory {
50   public:
51     EllipseItemFactory();
52     ~EllipseItemFactory();
53     ViewItem* generateGraphics(QXmlStreamReader& stream, ObjectStore *store, View *view, ViewItem *parent = 0);
54 };
55 }
56 
57 #endif
58 
59 // vim: ts=2 sw=2 et
60