karbon

vsinustool.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 __VSINUSTOOL_H__
00021 #define __VSINUSTOOL_H__
00022 
00023 #include <kdialogbase.h>
00024 #include "vshapetool.h"
00025 
00026 class KoUnitDoubleSpinBox;
00027 class KIntSpinBox;
00028 class KarbonView;
00029 class QLabel;
00030 
00031 class VSinusTool : public VShapeTool
00032 {
00033 public:
00034     VSinusTool( KarbonView *view );
00035     virtual ~VSinusTool();
00036 
00037     virtual void setup(KActionCollection *collection);
00038     virtual bool showDialog() const;
00039     virtual QString uiname() { return i18n( "Sinus Tool" ); }
00040 
00041     virtual VPath *shape( bool interactive = false ) const;
00042 
00043     void refreshUnit();
00044 
00045 private:
00046     class VSinusOptionsWidget : public KDialogBase
00047     {
00048     public:
00049         VSinusOptionsWidget( KarbonPart *part, QWidget *parent = 0L, const char *name = 0L );
00050 
00051         double width() const;
00052         double height() const;
00053         uint periods() const;
00054         void setWidth( double value );
00055         void setHeight( double value );
00056         void setPeriods( uint value );
00057         void refreshUnit();
00058 
00059     private:
00060         KoUnitDoubleSpinBox     *m_width;
00061         KoUnitDoubleSpinBox     *m_height;
00062         KIntSpinBox         *m_periods;
00063         KarbonPart          *m_part;
00064         QLabel              *m_heightLabel;
00065         QLabel              *m_widthLabel;
00066     };
00067 
00068     VSinusOptionsWidget *m_optionsWidget;
00069 };
00070 
00071 #endif
00072 
KDE Home | KDE Accessibility Home | Description of Access Keys