kspread

kspread_generalProperty.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 "kspread_global.h"
24
25#include <KoRect.h>
26#include <KoUnit.h>
27
28class KoGeneralPropertyUI;
29
30namespace KSpread
31{
32
33class GeneralProperty : public TQWidget
34{
35 TQ_OBJECT
36
37public:
38 struct GeneralValue
39 {
40 GeneralValue()
41 {}
42 TQString m_name;
43 PropValue m_keepRatio;
44 PropValue m_protect;
45 KoRect m_rect;
46 };
47
48 enum GeneralConfigChange
49 {
50 Name = 1,
51 Protect = 2,
52 KeepRatio = 4,
53 Left = 8,
54 Top = 16,
55 Width = 32,
56 Height = 64
57 };
58
59 GeneralProperty( TQWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit );
60 ~GeneralProperty();
61
62 int getGeneralPropertyChange() const;
63 GeneralValue getGeneralValue() const;
64
65 void apply();
66
67protected:
68 KoRect getRect() const;
69 void setRect( KoRect &rect );
70
71 KoGeneralPropertyUI *m_ui;
72 double m_ratio;
73
74 GeneralValue m_generalValue;
75 KoUnit::Unit m_unit;
76
77protected slots:
78 void slotReset();
79 void slotProtectToggled( bool state );
80 void slotKeepRatioToggled( bool state );
81 void slotWidthChanged( double value );
82 void slotHeightChanged( double value );
83};
84
85}
86
87#endif /* GENERALPROPERTY_H */
The KSpread namespace.
Definition commands.h:39