karbon

vpolygontool.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 __VPOLYGONTOOL_H__
00021 #define __VPOLYGONTOOL_H__
00022 
00023 #include <kdialogbase.h>
00024 
00025 #include "vshapetool.h"
00026 
00027 class KoUnitDoubleSpinBox;
00028 class KIntSpinBox;
00029 
00030 
00031 class VPolygonTool : public VShapeTool
00032 {
00033 public:
00034     VPolygonTool( KarbonView *view );
00035     virtual ~VPolygonTool();
00036 
00037     virtual void setup(KActionCollection *collection);
00038     virtual bool showDialog() const;
00039     virtual QString uiname() { return i18n( "Polygon Tool" ); }
00040 
00041     virtual VPath *shape( bool interactive = false ) const;
00042 
00043     void refreshUnit();
00044 
00045     virtual void arrowKeyReleased( Qt::Key );
00046 
00047 private:
00048     class VPolygonOptionsWidget : public KDialogBase
00049     {
00050     public:
00051         VPolygonOptionsWidget( KarbonView *view, QWidget *parent = 0L, const char *name = 0L );
00052 
00053         double radius() const;
00054         uint edges() const;
00055         void setRadius( double value );
00056         void setEdges( uint value );
00057 
00058         void refreshUnit();
00059 
00060     private:
00061         KoUnitDoubleSpinBox     *m_radius;
00062         KIntSpinBox         *m_edges;
00063         KarbonView              *m_view;
00064     };
00065 
00066     VPolygonOptionsWidget* m_optionsWidget;
00067 };
00068 
00069 #endif
00070 
KDE Home | KDE Accessibility Home | Description of Access Keys