kexiformmanager.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
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 KEXIFORMMANAGER_H
21#define KEXIFORMMANAGER_H
22
23#include <formmanager.h>
24#include <kexipart.h>
25
26class KCommand;
27class KexiFormView;
28
31class KEXIFORMUTILS_EXPORT KexiFormManager : public KFormDesigner::FormManager
32{
33 TQ_OBJECT
34
35
36 public:
37 KexiFormManager(KexiPart::Part *parent, const char* name = 0);
38 virtual ~KexiFormManager();
39
40 virtual TDEAction* action( const char* name );
41 virtual void enableAction( const char* name, bool enable );
42
43 public slots:
45 void setFormDataSource(const TQCString& mime, const TQCString& name);
46
53 void setDataSourceFieldOrExpression(const TQString& string, const TQString& caption,
55
57 void insertAutoFields(const TQString& sourceMimeType, const TQString& sourceName,
58 const TQStringList& fields);
59
60 protected slots:
61 void slotHistoryCommandExecuted();
62
63 protected:
64 inline TQString translateName( const char* name ) const;
65
66 private:
68 KexiFormView* activeFormViewWidget() const;
69
70// virtual bool loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf);
71// virtual bool saveFormToStringInternal(Form *form, TQString &dest, int indent = 0);
72
73 KexiPart::Part* m_part;
74};
75
76TQString KexiFormManager::translateName( const char* name ) const
77{
78 TQString n( name );
79 //translate to our name space:
80 if (n.startsWith("align_") || n.startsWith("adjust_") || n.startsWith("layout_")
81 || n=="format_raise" || n=="format_raise" || n=="taborder" | n=="break_layout")
82 {
83 n.prepend("formpart_");
84 }
85 return n;
86}
87
88#endif
A class to manage (create/load/save) Forms.
Definition formmanager.h:73
virtual TDEAction * action(const char *name)=0
virtual void enableAction(const char *name, bool enable)=0
The KexiFormView lass provides a data-driven (record-based) form view .
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
type * findParent(TQObject *o, const char *className, TQObject *&prevPrev)