kexi

spring.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
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 SPACER_H
21#define SPACER_H
22
23#include <tqwidget.h>
24
25class TQDomElement;
26class TQDomDocument;
27
28namespace KFormDesigner {
29
30class ObjectTreeItem;
31class Container;
32class WidgetLibrary;
33
34}
35
36class KFORMEDITOR_EXPORT Spring : public TQWidget
37{
38 TQ_OBJECT
39
40 TQ_ENUMS(SizeType)
41 TQ_PROPERTY(Orientation orientation READ orientation WRITE setOrientation)
42 TQ_PROPERTY(SizeType sizeType READ sizeType WRITE setSizeType)
43
44 private:
45 enum {HSize = 6, HMask = 0x3f, VMask = HMask << HSize, MayGrow = 1, ExpMask = 2, MayShrink = 4 };
46 public:
47 enum SizeType {Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink , MinimumExpanding = Minimum|ExpMask,
48 Expanding = MinimumExpanding|MayShrink };
49
50 public:
51 Spring(TQWidget *parent, const char *name);
52 ~Spring() {;}
53
54 static bool isPropertyVisible(const TQCString &name);
55 static void saveSpring(KFormDesigner::ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &domDoc, bool insideGridLayout);
56
57 void setOrientation(Orientation orient);
58 Orientation orientation() const { return m_orient;}
59 void setSizeType(SizeType size);
60 SizeType sizeType() const;
61
62 void setPreviewMode() { m_edit = false; }
63
64 private:
65 void paintEvent(TQPaintEvent *ev);
66
67 private:
68 Orientation m_orient;
69 bool m_edit;
70};
71
72
73#endif
74
75
This class makes a container out of any TQWidget.
Definition container.h:74
An item representing a widget Holds the properties of a widget (classname, name, parent,...
Definition objecttree.h:59
This class searches for factories and provides TDEActions for widget creation.