karbon

vrectangletool.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 __VRECTANGLETOOL_H__
21#define __VRECTANGLETOOL_H__
22
23
24#include <tdelocale.h>
25#include <kdialogbase.h>
26
27#include "vshapetool.h"
28
29class KarbonView;
30class TQLabel;
31class KoUnitDoubleSpinBox;
32
33class VRectangleTool : public VShapeTool
34{
35public:
36 VRectangleTool( KarbonView *view );
37 virtual ~VRectangleTool();
38
39 virtual void setup(TDEActionCollection *collection);
40 virtual bool showDialog() const;
41 virtual TQString uiname() { return i18n( "Rectangle Tool" ); }
42 virtual VPath* shape( bool interactive = false ) const;
43
44 void refreshUnit();
45
46private:
47 class VRectangleOptionsWidget : public KDialogBase
48 {
49 public:
50 VRectangleOptionsWidget( KarbonPart *part, TQWidget* parent = 0L, const char* name = 0L );
51
52 double width() const;
53 double height() const;
54 void setWidth( double value );
55 void setHeight( double value );
56 void refreshUnit();
57
58 private:
59 KoUnitDoubleSpinBox *m_width;
60 KoUnitDoubleSpinBox *m_height;
61 KarbonPart *m_part;
62 TQLabel *m_heightLabel;
63 TQLabel *m_widthLabel;
64 };
65
66 VRectangleOptionsWidget *m_optionWidget;
67};
68
69#endif
70
Keeps track of visual per document properties.
Definition karbon_part.h:46
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
KarbonView * view() const
Returns the connected karbon part.
Definition vtool.cpp:66