karbon

vstartool.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 __VSTARTOOL_H__
00021 #define __VSTARTOOL_H__
00022 
00023 #include <klocale.h>
00024 #include <kdialogbase.h>
00025 
00026 #include "vshapetool.h"
00027 
00028 
00029 class KoUnitDoubleSpinBox;
00030 class KIntSpinBox;
00031 class KComboBox;
00032 class KarbonView;
00033 
00034 class VStarOptionsWidget : public KDialogBase
00035 {
00036 Q_OBJECT
00037 public:
00038     VStarOptionsWidget( KarbonPart *part, QWidget* parent = 0L, const char* name = 0L );
00039 
00040     void refreshUnit();
00041 
00042     int edges() const;
00043     double innerRadius() const;
00044     double outerRadius() const;
00045     double roundness() const;
00046     uint type() const;
00047     uint innerAngle() const;
00048     void setInnerRadius( double );
00049 
00050 public slots:
00051     void typeChanged( int );
00052     void setEdges( int );
00053     void setOuterRadius( double );
00054 
00055 private:
00056     KoUnitDoubleSpinBox     *m_innerR;
00057     KoUnitDoubleSpinBox     *m_outerR;
00058     KDoubleNumInput         *m_roundness;
00059     KIntSpinBox         *m_edges;
00060     KIntSpinBox         *m_innerAngle;
00061     KComboBox           *m_type;
00062     KarbonPart          *m_part;
00063     QLabel              *m_innerRLabel;
00064     QLabel              *m_outerRLabel;
00065 };
00066 
00067 class VStarTool : public VShapeTool
00068 {
00069 public:
00070     VStarTool( KarbonView *view );
00071     virtual ~VStarTool();
00072 
00073     virtual bool showDialog() const;
00074     virtual void setup(KActionCollection *collection);
00075     virtual QString uiname() { return i18n( "Star Tool" ); }
00076     virtual VPath* shape( bool interactive = false ) const;
00077 
00078     void refreshUnit();
00079 
00080     virtual void arrowKeyReleased( Qt::Key );
00081 
00082 private:
00083     VStarOptionsWidget* m_optionsWidget;
00084 };
00085 
00086 #endif
00087 
KDE Home | KDE Accessibility Home | Description of Access Keys