kexicelleditorfactory.h
1/* This file is part of the KDE project
2 Copyright (C) 2004-2007 Jaroslaw Staniek <js@iidea.pl>
3
4 This program 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 program 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 program; see the file COPYING. 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 KEXICELLEDITORFACTORY_H
21#define KEXICELLEDITORFACTORY_H
22
23#include <tqvariant.h>
24#include <tqwidget.h>
25
26#include <kexidb/field.h>
27
29class KexiTableEdit;
31
33class KEXIDATATABLE_EXPORT KexiCellEditorFactory
34{
35 public:
37 virtual ~KexiCellEditorFactory();
38
46 static void registerItem( KexiCellEditorFactoryItem& item, uint type,
47 const TQString& subType = TQString() );
48
52 static KexiCellEditorFactoryItem* item( uint type, const TQString& subType = TQString() );
53
54// static KexiTableEdit* createEditor(KexiDB::Field &f, TQScrollView* parent = 0);
57 static KexiTableEdit* createEditor(KexiTableViewColumn &column, TQWidget* parent = 0);
58
59 protected:
60 static void init();
61};
62
64class KEXIDATATABLE_EXPORT KexiCellEditorFactoryItem
65{
66 public:
69 TQString className() { return m_className; }
70
71 protected:
72// virtual KexiTableEdit* createEditor(KexiDB::Field &f, TQScrollView* parent = 0) = 0;
73 virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, TQWidget* parent = 0) = 0;
74
75 TQString m_className;
76 friend class KexiCellEditorFactory;
77};
78
79#endif
A base class for implementing cell editor factories.
A singleton class providing access to cell editor factories.
Abstract class for a cell editor. Handles cell painting and displaying the editor widget.