1
/* This file is part of the KDE project
2
Copyright (C) 2003 by Lucijan Busch <lucijan@kde.org>
3
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
4
Copyright (C) 2009 Jarosław Staniek <staniek@kde.org>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with this library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
22
#ifndef STDWIDGETFACTORY_H
23
#define STDWIDGETFACTORY_H
31
#include "widgetfactory.h"
32
#include "container.h"
33
#include "FormWidgetInterface.h"
35
class QTreeWidgetItem;
43
//! A picture label widget for use within forms
44
class KexiPictureLabel : public QLabel, public KFormDesigner::FormWidgetInterface
49
KexiPictureLabel(const QPixmap &pix, QWidget *parent);
50
virtual ~KexiPictureLabel();
52
virtual bool setProperty(const char *name, const QVariant &value);
55
//! A line widget for use within forms
56
class Line : public QFrame, public KFormDesigner::FormWidgetInterface
59
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
62
Line(Qt::Orientation orient, QWidget *parent);
65
void setOrientation(Qt::Orientation orient);
66
Qt::Orientation orientation() const;
69
//! Factory for all basic widgets, including Spring (not containers)
70
class StdWidgetFactory : public KFormDesigner::WidgetFactory
75
StdWidgetFactory(QObject *parent, const QVariantList &args);
78
virtual QWidget* createWidget(const QByteArray &classname, QWidget *parent, const char *name,
79
KFormDesigner::Container *container,
80
CreateWidgetOptions options = DefaultOptions);
82
virtual bool createMenuActions(const QByteArray &classname, QWidget *w,
83
QMenu *menu, KFormDesigner::Container *container);
84
virtual bool startInlineEditing(InlineEditorCreationArguments& args);
85
virtual bool previewWidget(const QByteArray &classname, QWidget *widget,
86
KFormDesigner::Container *container);
87
virtual bool clearWidgetContent(const QByteArray &classname, QWidget *w);
89
virtual bool saveSpecialProperty(const QByteArray &classname,
90
const QString &name, const QVariant &value, QWidget *w,
91
QDomElement &parentNode, QDomDocument &parent);
92
virtual bool readSpecialProperty(const QByteArray &classname, QDomElement &node,
93
QWidget *w, KFormDesigner::ObjectTreeItem *item);
95
virtual void setPropertyOptions(KoProperty::Set& set, const KFormDesigner::WidgetInfo& info, QWidget *w);
97
//! Moved into public for EditRichTextAction
98
bool editRichText(QWidget *w, QString &text) const { return KFormDesigner::WidgetFactory::editRichText(w, text); }
100
//! Moved into public for EditRichTextAction
101
void changeProperty(KFormDesigner::Form *form, QWidget *widget, const char *name,
102
const QVariant &value) { KFormDesigner::WidgetFactory::changeProperty(form, widget, name, value); }
105
// moved to EditRichTextAction
107
#ifndef KEXI_FORMS_NO_LIST_WIDGET
108
void editListContents();
112
virtual bool isPropertyVisibleInternal(const QByteArray &classname, QWidget *w,
113
const QByteArray &property, bool isTopLevel);
114
virtual bool changeInlineText(KFormDesigner::Form *form, QWidget *widget,
115
const QString &text, QString &oldText);
116
virtual void resizeEditor(QWidget *editor, QWidget *widget, const QByteArray &classname);
117
#ifndef KEXI_FORMS_NO_LIST_WIDGET
118
void saveTreeItem(QTreeWidgetItem *item, QDomNode &parentNode, QDomDocument &domDoc);
119
void readTreeItem(QDomElement &node, QTreeWidgetItem *parent, QTreeWidget *treewidget);
123
// KFormDesigner::Container *m_container;
124
// QWidget *m_widget;