1
/* This file is part of the KDE project
2
Copyright (C) 2005-2006 Jarosław Staniek <staniek@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this program; see the file COPYING. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef KEXIFIELDCOMBOBOX_H
21
#define KEXIFIELDCOMBOBOX_H
23
#include "kexiextwidgets_export.h"
29
/*! This widget provides a list of fields from a table or query
30
within a combobox, so user can pick one of them.
32
class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox
37
explicit KexiFieldComboBox(QWidget *parent = 0);
38
virtual ~KexiFieldComboBox();
41
//! \return global project that is used to retrieve schema informationm for this combo box.
42
KexiProject* project() const;
44
//! Sets global project that is used to retrieve schema informationm for this combo box.
45
void setProject(KexiProject *prj);
47
void setTableOrQuery(const QString& name, bool table);
48
QString tableOrQueryName() const;
49
bool isTableAssigned() const;
50
void setFieldOrExpression(const QString& string);
51
void setFieldOrExpression(int index);
52
QString fieldOrExpression() const;
53
QString fieldOrExpressionCaption() const;
55
/*! \return index of selected table or query field.
56
-1 is returned if there is nothing selected or expression is selected
57
of project is not assigned or table or query is not assigned. */
58
int indexOfField() const;
64
void slotActivated(int);
65
void slotReturnPressed(const QString & text);
68
virtual void focusOutEvent(QFocusEvent *e);