karbon

vsinustool.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 2002, 2003 The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VSINUSTOOL_H__
21#define __VSINUSTOOL_H__
22
23#include <kdialogbase.h>
24#include "vshapetool.h"
25
26class KoUnitDoubleSpinBox;
27class KIntSpinBox;
28class KarbonView;
29class TQLabel;
30
31class VSinusTool : public VShapeTool
32{
33public:
34 VSinusTool( KarbonView *view );
35 virtual ~VSinusTool();
36
37 virtual void setup(TDEActionCollection *collection);
38 virtual bool showDialog() const;
39 virtual TQString uiname() { return i18n( "Sinus Tool" ); }
40
41 virtual VPath *shape( bool interactive = false ) const;
42
43 void refreshUnit();
44
45private:
46 class VSinusOptionsWidget : public KDialogBase
47 {
48 public:
49 VSinusOptionsWidget( KarbonPart *part, TQWidget *parent = 0L, const char *name = 0L );
50
51 double width() const;
52 double height() const;
53 uint periods() const;
54 void setWidth( double value );
55 void setHeight( double value );
56 void setPeriods( uint value );
57 void refreshUnit();
58
59 private:
60 KoUnitDoubleSpinBox *m_width;
61 KoUnitDoubleSpinBox *m_height;
62 KIntSpinBox *m_periods;
63 KarbonPart *m_part;
64 TQLabel *m_heightLabel;
65 TQLabel *m_widthLabel;
66 };
67
68 VSinusOptionsWidget *m_optionsWidget;
69};
70
71#endif
72
virtual TQString uiname()
The name of the tool.
Definition vtool.h:93
virtual void refreshUnit()
This function is called when the documents unit setting were changed.
Definition vtool.h:138
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66
virtual bool showDialog() const
Shows the tools option dialog.
Definition vtool.h:88