karbon
vellipsetool.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VELLIPSETOOL_H__
00021 #define __VELLIPSETOOL_H__
00022
00023 #include <kdialogbase.h>
00024
00025 #include "vshapetool.h"
00026
00027 class KoUnitDoubleSpinBox;
00028 class KComboBox;
00029 class KIntSpinBox;
00030 class KarbonView;
00031 class QLabel;
00032 class QWidget;
00033
00034 class VEllipseOptionsWidget : public KDialogBase
00035 {
00036 Q_OBJECT
00037 public:
00038 VEllipseOptionsWidget( KarbonPart *part, QWidget *parent = 0L, const char *name = 0L );
00039
00040 double width() const;
00041 double height() const;
00042 uint startAngle() const;
00043 uint endAngle() const;
00044 uint type() const;
00045 void setWidth( double value );
00046 void setHeight( double value );
00047 void refreshUnit();
00048
00049 public slots:
00050 void typeChanged( int );
00051
00052 private:
00053 KComboBox *m_type;
00054 KIntSpinBox *m_startAngle;
00055 KIntSpinBox *m_endAngle;
00056 KoUnitDoubleSpinBox *m_width;
00057 KoUnitDoubleSpinBox *m_height;
00058 KarbonPart *m_part;
00059 QLabel *m_heightLabel;
00060 QLabel *m_widthLabel;
00061 };
00062
00063 class VEllipseTool : public VShapeTool
00064 {
00065 public:
00066 VEllipseTool( KarbonView *view );
00067 virtual ~VEllipseTool();
00068
00069 virtual void setup(KActionCollection *collection);
00070 virtual bool showDialog() const;
00071 virtual QString uiname() { return i18n( "Ellipse Tool" ); }
00072 virtual VPath *shape( bool interactive = false ) const;
00073 void refreshUnit();
00074
00075 protected:
00076 void mouseDragRelease();
00077 void mouseMove();
00078 void mouseButtonPress();
00079 void mouseButtonRelease();
00080 void cancel();
00081
00082 private:
00083 enum { normal, startangle, endangle } m_state;
00084 VEllipseOptionsWidget *m_optionsWidget;
00085 double m_startAngle;
00086 double m_endAngle;
00087 KoPoint m_center;
00088 };
00089
00090 #endif
00091
|