karbon

vellipsetool.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, 2002, 2003 The Karbon Developers
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
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 
KDE Home | KDE Accessibility Home | Description of Access Keys