kexi

kexifieldlistview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003-2005 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 KEXIFIELDLISTVIEW_H
00021 #define KEXIFIELDLISTVIEW_H
00022 
00023 #include <qframe.h>
00024 #include <qpixmap.h>
00025 #include <klistview.h>
00026 
00027 namespace KexiDB {
00028     class TableOrQuerySchema;
00029 }
00030 
00033 class KEXIEXTWIDGETS_EXPORT KexiFieldListView : public KListView
00034 {
00035     Q_OBJECT
00036 
00037     public:
00039         enum Options { 
00040             ShowDataTypes = 1, 
00041             ShowAsterisk = 2, 
00042             AllowMultiSelection = 4 
00043         };
00044 
00045         KexiFieldListView(QWidget *parent, const char *name = 0, 
00046             int options = ShowDataTypes | AllowMultiSelection );
00047         virtual ~KexiFieldListView();
00048 
00051         void setSchema(KexiDB::TableOrQuerySchema* schema);
00052 
00054         KexiDB::TableOrQuerySchema* schema() const { return m_schema; }
00055 
00057         QStringList selectedFieldNames();
00058 
00059 //      void setReadOnly(bool);
00060 //      virtual QSize sizeHint();
00061 
00062     signals:
00064         void fieldDoubleClicked(const QString& sourceMimeType, const QString& sourceName,
00065             const QString& fieldName);
00066 
00067     protected slots:
00068         void slotDoubleClicked(QListViewItem* item);
00069 
00070     protected:
00071         virtual QDragObject *dragObject();
00072 
00073         KexiDB::TableOrQuerySchema* m_schema;
00074         QPixmap m_keyIcon; 
00075         QPixmap m_noIcon; 
00076         int m_options;
00077 };
00078 
00079 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys