kexi
spring.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SPACER_H
00021 #define SPACER_H
00022
00023 #include <qwidget.h>
00024
00025 class QDomElement;
00026 class QDomDocument;
00027
00028 namespace KFormDesigner {
00029
00030 class ObjectTreeItem;
00031 class Container;
00032 class WidgetLibrary;
00033
00034 }
00035
00036 class KFORMEDITOR_EXPORT Spring : public QWidget
00037 {
00038 Q_OBJECT
00039 Q_ENUMS(SizeType)
00040 Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation)
00041 Q_PROPERTY(SizeType sizeType READ sizeType WRITE setSizeType)
00042
00043 private:
00044 enum {HSize = 6, HMask = 0x3f, VMask = HMask << HSize, MayGrow = 1, ExpMask = 2, MayShrink = 4 };
00045 public:
00046 enum SizeType {Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink , MinimumExpanding = Minimum|ExpMask,
00047 Expanding = MinimumExpanding|MayShrink };
00048
00049 public:
00050 Spring(QWidget *parent, const char *name);
00051 ~Spring() {;}
00052
00053 static bool isPropertyVisible(const QCString &name);
00054 static void saveSpring(KFormDesigner::ObjectTreeItem *item, QDomElement &parent, QDomDocument &domDoc, bool insideGridLayout);
00055
00056 void setOrientation(Orientation orient);
00057 Orientation orientation() const { return m_orient;}
00058 void setSizeType(SizeType size);
00059 SizeType sizeType() const;
00060
00061 void setPreviewMode() { m_edit = false; }
00062
00063 private:
00064 void paintEvent(QPaintEvent *ev);
00065
00066 private:
00067 Orientation m_orient;
00068 bool m_edit;
00069 };
00070
00071
00072 #endif
00073
00074
|