kexi
kexicelleditorfactory.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2004-2007 Jaroslaw Staniek <js@iidea.pl> 00003 00004 This program 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 program 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 program; see the file COPYING. 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 KEXICELLEDITORFACTORY_H 00021 #define KEXICELLEDITORFACTORY_H 00022 00023 #include <qvariant.h> 00024 #include <qwidget.h> 00025 00026 #include <kexidb/field.h> 00027 00028 class KexiCellEditorFactoryItem; 00029 class KexiTableEdit; 00030 class KexiTableViewColumn; 00031 00033 class KEXIDATATABLE_EXPORT KexiCellEditorFactory 00034 { 00035 public: 00036 KexiCellEditorFactory(); 00037 virtual ~KexiCellEditorFactory(); 00038 00046 static void registerItem( KexiCellEditorFactoryItem& item, uint type, 00047 const QString& subType = QString::null ); 00048 00052 static KexiCellEditorFactoryItem* item( uint type, const QString& subType = QString::null ); 00053 00054 // static KexiTableEdit* createEditor(KexiDB::Field &f, QScrollView* parent = 0); 00057 static KexiTableEdit* createEditor(KexiTableViewColumn &column, QWidget* parent = 0); 00058 00059 protected: 00060 static void init(); 00061 }; 00062 00064 class KEXIDATATABLE_EXPORT KexiCellEditorFactoryItem 00065 { 00066 public: 00067 KexiCellEditorFactoryItem(); 00068 virtual ~KexiCellEditorFactoryItem(); 00069 QString className() { return m_className; } 00070 00071 protected: 00072 // virtual KexiTableEdit* createEditor(KexiDB::Field &f, QScrollView* parent = 0) = 0; 00073 virtual KexiTableEdit* createEditor(KexiTableViewColumn &column, QWidget* parent = 0) = 0; 00074 00075 QString m_className; 00076 friend class KexiCellEditorFactory; 00077 }; 00078 00079 #endif