kexi

kexifieldlistview.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
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 KEXIFIELDLISTVIEW_H
21#define KEXIFIELDLISTVIEW_H
22
23#include <tqframe.h>
24#include <tqpixmap.h>
25#include <tdelistview.h>
26
27class TDEListViewItem;
28
29namespace KexiDB {
31}
32
35class KEXIEXTWIDGETS_EXPORT KexiFieldListView : public TDEListView
36{
37 TQ_OBJECT
38
39
40 public:
47
48 KexiFieldListView(TQWidget *parent, const char *name = 0,
49 int options = ShowDataTypes | AllowMultiSelection );
50 virtual ~KexiFieldListView();
51
54 void setSchema(KexiDB::TableOrQuerySchema* schema);
55
57 KexiDB::TableOrQuerySchema* schema() const { return m_schema; }
58
60 TQStringList selectedFieldNames() const;
61
62// void setReadOnly(bool);
63// virtual TQSize sizeHint();
64
65 signals:
67 void fieldDoubleClicked(const TQString& sourceMimeType, const TQString& sourceName,
68 const TQString& fieldName);
69
70 protected slots:
71 void slotDoubleClicked(TQListViewItem* item);
72
73 protected:
74 virtual TQDragObject *dragObject();
75
77 TQPixmap m_keyIcon;
78 TQPixmap m_noIcon;
79 int m_options;
80 TDEListViewItem *m_allColumnsItem;
81};
82
83#endif
TQPixmap m_keyIcon
a small "primary key" icon for 0-th column
void fieldDoubleClicked(const TQString &sourceMimeType, const TQString &sourceName, const TQString &fieldName)
TQPixmap m_noIcon
blank icon of the same size as m_keyIcon
KexiDB::TableOrQuerySchema * schema() const
Options
Flags used to alter list's behaviour and appearance.
@ ShowDataTypes
if set, 'data type' column is added
@ AllowMultiSelection
if set, multiple selection is allowed
@ ShowAsterisk
if set, asterisk ('*') item is prepended to the list
void slotDoubleClicked(TQListViewItem *item)
High-level database connectivity library with database backend drivers.