kexi

kexicomboboxpopup.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004-2006 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 KEXICOMBOBOXPOPUP_H
00021 #define KEXICOMBOBOXPOPUP_H
00022 
00023 #include <qframe.h>
00024 
00025 class KexiComboBoxPopupPrivate;
00026 class KexiTableView;
00027 class KexiTableViewData;
00028 class KexiTableViewColumn;
00029 class KexiTableItem;
00030 namespace KexiDB {
00031     class Field;
00032 }
00033 
00035 class KexiComboBoxPopup : public QFrame
00036 {
00037     Q_OBJECT
00038     public:
00039 //js TODO: more ctors!
00044         KexiComboBoxPopup(QWidget* parent, KexiTableViewColumn &column);
00045 
00047         KexiComboBoxPopup(QWidget* parent, KexiDB::Field &field);
00048 
00049         virtual ~KexiComboBoxPopup();
00050 
00051         KexiTableView* tableView();
00052 
00054         void setMaxRows(int r);
00055 
00057         int maxRows() const;
00058 
00060         static const int defaultMaxRows;
00061 
00062         virtual bool eventFilter( QObject *o, QEvent *e );
00063 
00064     signals:
00065         void rowAccepted(KexiTableItem *item, int row);
00066         void cancelled();
00067         void hidden();
00068 
00069     public slots:
00070         virtual void resize( int w, int h );
00071         void updateSize(int minWidth = 0);
00072 
00073     protected slots:
00074         void slotTVItemAccepted(KexiTableItem *item, int row, int col);
00075         void slotDataReloadRequested();
00076 
00077     protected:
00078         void init();
00081         void setData(KexiTableViewColumn *column, KexiDB::Field *field);
00082 
00084         void setDataInternal( KexiTableViewData *data, bool owner = true ); 
00085 
00086         KexiComboBoxPopupPrivate *d;
00087 
00088         friend class KexiComboBoxTableEdit;
00089 };
00090 
00091 #endif
00092 
KDE Home | KDE Accessibility Home | Description of Access Keys