kexi

stdwidgetfactory.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 STDWIDGETFACTORY_H
21#define STDWIDGETFACTORY_H
22
23#include <tqframe.h>
24
25#include "widgetfactory.h"
26#include "container.h"
27
28class KFORMEDITOR_EXPORT KexiPictureLabel : public TQLabel
29{
30 TQ_OBJECT
31
32
33 public:
34 KexiPictureLabel(const TQPixmap &pix, TQWidget *parent, const char *name);
35 ~KexiPictureLabel(){;}
36
37 virtual bool setProperty(const char *name, const TQVariant &value);
38};
39
40class KFORMEDITOR_EXPORT Line : public TQFrame
41{
42 TQ_OBJECT
43
44 TQ_PROPERTY(Orientation orientation READ orientation WRITE setOrientation)
45
46 public:
47 Line(Orientation orient, TQWidget *parent, const char *name);
48 ~Line(){;}
49
50 void setOrientation(Orientation orient);
51 Orientation orientation() const;
52};
53
56{
57 TQ_OBJECT
58
59
60 public:
61 StdWidgetFactory(TQObject *parent, const char *name, const TQStringList &args);
63
64 virtual TQWidget *createWidget(const TQCString &c, TQWidget *p, const char *n,
65 KFormDesigner::Container *container, int options = DefaultOptions);
66
67 virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu,
68 KFormDesigner::Container *container);
69 virtual bool startEditing(const TQCString &classname, TQWidget *w,
70 KFormDesigner::Container *container);
71 virtual bool previewWidget(const TQCString &classname, TQWidget *widget,
72 KFormDesigner::Container *container);
73 virtual bool clearWidgetContent(const TQCString &classname, TQWidget *w);
74
75 virtual bool saveSpecialProperty(const TQCString &classname,
76 const TQString &name, const TQVariant &value, TQWidget *w,
77 TQDomElement &parentNode, TQDomDocument &parent);
78 virtual bool readSpecialProperty(const TQCString &classname, TQDomElement &node,
79 TQWidget *w, KFormDesigner::ObjectTreeItem *item);
80 virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname);
81
82 virtual void setPropertyOptions( KFormDesigner::WidgetPropertySet& buf,
83 const KFormDesigner::WidgetInfo& info, TQWidget *w );
84
85 public slots:
86 void editText();
87 void editListContents();
88
89 protected:
90 virtual bool isPropertyVisibleInternal(const TQCString &classname, TQWidget *w,
91 const TQCString &property, bool isTopLevel);
92 virtual bool changeText(const TQString &newText);
93 virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname);
94 void saveListItem(TQListViewItem *item, TQDomNode &parentNode, TQDomDocument &domDoc);
95 void readListItem(TQDomElement &node, TQListViewItem *parent, TDEListView *listview);
96
97 private:
98// KFormDesigner::Container *m_container;
99// TQWidget *m_widget;
100};
101
102#endif
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
The base class for all widget Factories.
This class holds properties of widget classes provided by a factory.
virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container)
virtual bool readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item)
virtual bool saveSpecialProperty(const TQCString &classname, const TQString &name, const TQVariant &value, TQWidget *w, TQDomElement &parentNode, TQDomDocument &parent)
virtual TQValueList< TQCString > autoSaveProperties(const TQCString &classname)
virtual bool previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *container)
virtual TQWidget * createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options=DefaultOptions)
Creates a widget (and if needed a KFormDesigner::Container).
StdWidgetFactory(TQObject *parent, const char *name, const TQStringList &args)
virtual void setPropertyOptions(KFormDesigner::WidgetPropertySet &buf, const KFormDesigner::WidgetInfo &info, TQWidget *w)
virtual bool startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container)
virtual bool changeText(const TQString &newText)
virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname)
virtual bool isPropertyVisibleInternal(const TQCString &classname, TQWidget *w, const TQCString &property, bool isTopLevel)