kpresenter

KPrGeneralProperty.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
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#ifndef GENERALPROPERTY_H
20#define GENERALPROPERTY_H
21
22#include <tqwidget.h>
23#include <global.h>
24
25#include <KoRect.h>
26#include <KoUnit.h>
27
28class KoGeneralPropertyUI;
29
30class KPrGeneralProperty : public TQWidget
31{
32 TQ_OBJECT
33
34public:
35 struct GeneralValue
36 {
37 GeneralValue()
38 {}
39 TQString m_name;
40 PropValue m_keepRatio;
41 PropValue m_protect;
42 KoRect m_rect;
43 };
44
45 enum GeneralConfigChange
46 {
47 Name = 1,
48 Protect = 2,
49 KeepRatio = 4,
50 Left = 8,
51 Top = 16,
52 Width = 32,
53 Height = 64
54 };
55
56 KPrGeneralProperty( TQWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit );
57 ~KPrGeneralProperty();
58
59 int getGeneralPropertyChange() const;
60 GeneralValue getGeneralValue() const;
61
62 void apply();
63
64protected:
65 KoRect getRect() const;
66 void setRect( KoRect &rect );
67
68 KoGeneralPropertyUI *m_ui;
69 double m_ratio;
70
71 GeneralValue m_generalValue;
72 KoUnit::Unit m_unit;
73
74protected slots:
75 void slotReset();
76 void slotProtectToggled( bool state );
77 void slotKeepRatioToggled( bool state );
78 void slotWidthChanged( double value );
79 void slotHeightChanged( double value );
80};
81
82#endif /* GENERALPROPERTY_H */