1
/* This file is part of the KDE project
2
Copyright (C) 2005-2009 Jarosław Staniek <staniek@kde.org>
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.
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.
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.
20
#ifndef KEXIFORMMANAGER_H
21
#define KEXIFORMMANAGER_H
23
#include "kexiformpart.h"
28
class KActionCollection;
29
class KexiFormManagerPrivate;
31
namespace KFormDesigner {
33
class WidgetTreeWidget;
39
class KEXIFORMUTILS_EXPORT KexiFormManager : public QObject
44
static KexiFormManager* self();
46
//! Called by KexiFormPart()
47
void init(KexiFormPart *part, KFormDesigner::WidgetTreeWidget *widgetTree);
49
virtual QAction* action(const char* name);
50
virtual void enableAction(const char* name, bool enable);
52
KFormDesigner::WidgetLibrary* library() const;
54
/*! @return action group containing "insert widget" actions for each widget. */
55
KFormDesigner::ActionGroup* widgetActionGroup() const;
60
virtual ~KexiFormManager();
63
//! Receives signal from KexiDataSourcePage about changed form's data source
64
void setFormDataSource(const QString& mime, const QString& name);
66
/*! Receives signal from KexiDataSourcePage about changed widget's data source.
67
This is because we couldn't pass objects like KDbQueryColumnInfo.
69
Also sets following things in KexiDBAutoField:
70
- caption related to the data source
71
- data type related to the data source */
72
void setDataSourceFieldOrExpression(const QString& string, const QString& caption,
75
/*! Receives signal from KexiDataSourcePage and inserts autofields onto the current form. */
76
void insertAutoFields(const QString& sourcePartClass, const QString& sourceName,
77
const QStringList& fields);
79
/*! For debugging purposes only:
80
shows a text window containing contents of .ui XML definition of the current form. */
81
void showFormUICode();
84
void slotHistoryCommandExecuted(KFormDesigner::Command *command);
85
void slotWidgetCreatedByFormsLibrary(QWidget* widget);
86
void slotWidgetActionToggled(const QByteArray& action);
87
void slotAssignAction();
88
void slotPointerClicked();
91
QString translateName(const char* name) const;
94
//! Helper: return active form's view widget or 0 if there's no active form having such widget
95
KexiFormView* activeFormViewWidget() const;
98
void createActions(KActionCollection* collection);
100
friend class KexiFormManagerPrivate;
101
KexiFormManagerPrivate * const d;