kexi

stdwidgetfactory.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef STDWIDGETFACTORY_H
00021 #define STDWIDGETFACTORY_H
00022 
00023 #include <qframe.h>
00024 
00025 #include "widgetfactory.h"
00026 #include "container.h"
00027 
00028 class KFORMEDITOR_EXPORT KexiPictureLabel : public QLabel
00029 {
00030     Q_OBJECT
00031 
00032     public:
00033         KexiPictureLabel(const QPixmap &pix, QWidget *parent, const char *name);
00034         ~KexiPictureLabel(){;}
00035 
00036         virtual bool setProperty(const char *name, const QVariant &value);
00037 };
00038 
00039 class KFORMEDITOR_EXPORT Line : public QFrame
00040 {
00041     Q_OBJECT
00042     Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation)
00043 
00044     public:
00045         Line(Orientation orient, QWidget *parent, const char *name);
00046         ~Line(){;}
00047 
00048         void setOrientation(Orientation orient);
00049         Orientation  orientation() const;
00050 };
00051 
00053 class StdWidgetFactory : public KFormDesigner::WidgetFactory
00054 {
00055     Q_OBJECT
00056 
00057     public:
00058         StdWidgetFactory(QObject *parent, const char *name, const QStringList &args);
00059         ~StdWidgetFactory();
00060 
00061         virtual QWidget *createWidget(const QCString &c, QWidget *p, const char *n, 
00062             KFormDesigner::Container *container, int options = DefaultOptions);
00063 
00064         virtual bool createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu,
00065            KFormDesigner::Container *container);
00066         virtual bool startEditing(const QCString &classname, QWidget *w,
00067             KFormDesigner::Container *container);
00068         virtual bool previewWidget(const QCString &classname, QWidget *widget,
00069             KFormDesigner::Container *container);
00070         virtual bool clearWidgetContent(const QCString &classname, QWidget *w);
00071 
00072         virtual bool saveSpecialProperty(const QCString &classname,
00073             const QString &name, const QVariant &value, QWidget *w,
00074             QDomElement &parentNode, QDomDocument &parent);
00075         virtual bool readSpecialProperty(const QCString &classname, QDomElement &node,
00076             QWidget *w, KFormDesigner::ObjectTreeItem *item);
00077         virtual QValueList<QCString> autoSaveProperties(const QCString &classname);
00078 
00079         virtual void setPropertyOptions( KFormDesigner::WidgetPropertySet& buf,
00080              const KFormDesigner::WidgetInfo& info, QWidget *w );
00081 
00082     public slots:
00083         void  editText();
00084         void  editListContents();
00085 
00086     protected:
00087         virtual bool isPropertyVisibleInternal(const QCString &classname, QWidget *w,
00088             const QCString &property, bool isTopLevel);
00089         virtual bool changeText(const QString &newText);
00090         virtual void resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname);
00091         void saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDocument &domDoc);
00092         void readListItem(QDomElement &node, QListViewItem *parent, KListView *listview);
00093 
00094     private:
00095 //      KFormDesigner::Container *m_container;
00096 //      QWidget *m_widget;
00097 };
00098 
00099 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys