kexi

kexicomboboxpopup.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 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!
00042         KexiComboBoxPopup(QWidget* parent, KexiDB::Field &f);
00043         KexiComboBoxPopup(QWidget* parent, KexiTableViewColumn &column);
00044         virtual ~KexiComboBoxPopup();
00045 
00046         KexiTableView* tableView();
00047 
00049         void setMaxRows(int r);
00050 
00052         int maxRows() const;
00053 
00055         static const int defaultMaxRows;
00056 
00057         virtual bool eventFilter( QObject *o, QEvent *e );
00058 
00059     signals:
00060         void rowAccepted(KexiTableItem *item, int row);
00061         void cancelled();
00062         void hidden();
00063 
00064     public slots:
00065         virtual void resize( int w, int h );
00066         void updateSize(int minWidth = 0);
00067 
00068     protected slots:
00069         void slotTVItemAccepted(KexiTableItem *item, int row, int col);
00070         void slotDataReloadRequested();
00071 
00072     protected:
00073         void init();
00074         void setData(KexiDB::Field &f);
00075         void setData(KexiTableViewColumn &column);
00076         void setDataInternal( KexiTableViewData *data, bool owner = true ); 
00077 
00078         KexiComboBoxPopupPrivate *d;
00079 
00080         friend class KexiComboBoxTableEdit;
00081 };
00082 
00083 #endif
00084 
KDE Home | KDE Accessibility Home | Description of Access Keys