kexi

kexifieldcombobox.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005-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 KEXIFIELDCOMBOBOX_H
00021 #define KEXIFIELDCOMBOBOX_H
00022 
00023 #include <qpixmap.h>
00024 #include <kcombobox.h>
00025 
00026 namespace KexiDB {
00027     class TableOrQuerySchema;
00028 }
00029 class KexiProject;
00030 
00034 class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox
00035 {
00036     Q_OBJECT
00037 
00038     public:
00039         KexiFieldComboBox(QWidget *parent, const char *name = 0);
00040         virtual ~KexiFieldComboBox();
00041 
00042 //      /*! Sets table or query schema \a schema. 
00043 //       The schema object will be owned by the KexiFieldComboBox object. */
00044 //      void setSchema(KexiDB::TableOrQuerySchema* schema);
00045 
00046 //      KexiDB::TableOrQuerySchema* schema() const { return m_schema; }
00047 
00048     public slots:
00050         KexiProject* project() const;
00051 
00053         void setProject(KexiProject *prj);
00054 
00055         void setTableOrQuery(const QString& name, bool table);
00056         QString tableOrQueryName() const;
00057         bool isTableAssigned() const;
00058         void setFieldOrExpression(const QString& string);
00059         void setFieldOrExpression(int index);
00060         QString fieldOrExpression() const;
00061         QString fieldOrExpressionCaption() const;
00062 
00066         int indexOfField() const;
00067 
00068     signals:
00069         void selected();
00070 
00071     protected slots:
00072         void slotActivated(int);
00073         void slotReturnPressed(const QString & text);
00074 
00075     protected:
00076         virtual void focusOutEvent( QFocusEvent *e );
00077 
00078         class Private;
00079         Private *d;
00080 };
00081 
00082 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys