~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/widget/fields/KexiFieldComboBox.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2005-2006 Jarosław Staniek <staniek@kde.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
18
*/
 
19
 
 
20
#ifndef KEXIFIELDCOMBOBOX_H
 
21
#define KEXIFIELDCOMBOBOX_H
 
22
 
 
23
#include "kexiextwidgets_export.h"
 
24
 
 
25
#include <KComboBox>
 
26
 
 
27
class KexiProject;
 
28
 
 
29
/*! This widget provides a list of fields from a table or query
 
30
 within a combobox, so user can pick one of them.
 
31
*/
 
32
class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox
 
33
{
 
34
    Q_OBJECT
 
35
 
 
36
public:
 
37
    explicit KexiFieldComboBox(QWidget *parent = 0);
 
38
    virtual ~KexiFieldComboBox();
 
39
 
 
40
public Q_SLOTS:
 
41
    //! \return global project that is used to retrieve schema informationm for this combo box.
 
42
    KexiProject* project() const;
 
43
 
 
44
    //! Sets global project that is used to retrieve schema informationm for this combo box.
 
45
    void setProject(KexiProject *prj);
 
46
 
 
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;
 
54
 
 
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;
 
59
 
 
60
Q_SIGNALS:
 
61
    void selected();
 
62
 
 
63
protected Q_SLOTS:
 
64
    void slotActivated(int);
 
65
    void slotReturnPressed(const QString & text);
 
66
 
 
67
protected:
 
68
    virtual void focusOutEvent(QFocusEvent *e);
 
69
 
 
70
    class Private;
 
71
    Private * const d;
 
72
};
 
73
 
 
74
#endif