karbon

vellipsetool.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 2002, 2003 The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VELLIPSETOOL_H__
21#define __VELLIPSETOOL_H__
22
23#include <kdialogbase.h>
24
25#include "vshapetool.h"
26
27class KoUnitDoubleSpinBox;
28class KComboBox;
29class KIntSpinBox;
30class KarbonView;
31class TQLabel;
32class TQWidget;
33
34class VEllipseOptionsWidget : public KDialogBase
35{
36TQ_OBJECT
37
38public:
39 VEllipseOptionsWidget( KarbonPart *part, TQWidget *parent = 0L, const char *name = 0L );
40
41 double width() const;
42 double height() const;
43 uint startAngle() const;
44 uint endAngle() const;
45 uint type() const;
46 void setWidth( double value );
47 void setHeight( double value );
48 void refreshUnit();
49
50public slots:
51 void typeChanged( int );
52
53private:
54 KComboBox *m_type;
55 KIntSpinBox *m_startAngle;
56 KIntSpinBox *m_endAngle;
57 KoUnitDoubleSpinBox *m_width;
58 KoUnitDoubleSpinBox *m_height;
59 KarbonPart *m_part;
60 TQLabel *m_heightLabel;
61 TQLabel *m_widthLabel;
62};
63
64class VEllipseTool : public VShapeTool
65{
66public:
67 VEllipseTool( KarbonView *view );
68 virtual ~VEllipseTool();
69
70 virtual void setup(TDEActionCollection *collection);
71 virtual bool showDialog() const;
72 virtual TQString uiname() { return i18n( "Ellipse Tool" ); }
73 virtual VPath *shape( bool interactive = false ) const;
74 void refreshUnit();
75
76protected:
77 void mouseDragRelease();
78 void mouseMove();
79 void mouseButtonPress();
80 void mouseButtonRelease();
81 void cancel();
82
83private:
84 enum { normal, startangle, endangle } m_state;
85 VEllipseOptionsWidget *m_optionsWidget;
86 double m_startAngle;
87 double m_endAngle;
88 KoPoint m_center;
89};
90
91#endif
92
Keeps track of visual per document properties.
Definition karbon_part.h:46
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66