kexibooltableedit.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 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 KEXIBOOLTABLEEDIT_H
21#define KEXIBOOLTABLEEDIT_H
22
23#include <tqvariant.h>
24
25#include "kexitableedit.h"
26#include "kexicelleditorfactory.h"
27
31{
32 TQ_OBJECT
33
34
35 public:
36 KexiBoolTableEdit(KexiTableViewColumn &column, TQWidget *parent=0);
37
38 virtual ~KexiBoolTableEdit();
39
41 virtual bool valueIsNull();
42
46 virtual bool valueIsEmpty();
47
48 virtual TQVariant value();
49
50 virtual bool cursorAtStart();
51 virtual bool cursorAtEnd();
52
53 virtual void clear();
54
55 virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val,
56 TQString &txt, int &align, int &x, int &y_offset, int &w, int &h );
57
58 virtual void clickedOnContents();
59
62 virtual void handleAction(const TQString& actionName);
63
66 virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue);
67
69 virtual int widthForValue( TQVariant &val, const TQFontMetrics &fm );
70
71 protected slots:
72
73 protected:
75 virtual void setValueInternal(const TQVariant& add, bool removeOld);
76
77 void showHintButton();
78
80 TQVariant m_currentValue;
81
82 signals:
83 void hintClicked();
84};
85
86KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBoolEditorFactoryItem)
87
88#endif
Cell editor for boolean type.
virtual bool cursorAtEnd()
virtual void setValueInternal(const TQVariant &add, bool removeOld)
initializes this editor with add value
virtual void handleAction(const TQString &actionName)
virtual void handleCopyAction(const TQVariant &value, const TQVariant &visibleValue)
virtual int widthForValue(TQVariant &val, const TQFontMetrics &fm)
virtual void setupContents(TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
virtual void clickedOnContents()
TQVariant m_currentValue
We've no editor widget that would store current value, so we do this here.
virtual void clear()
clears item's data, so the data will contain NULL data
virtual bool cursorAtStart()
virtual bool valueIsEmpty()
virtual bool valueIsNull()
virtual TQVariant value()
virtual TQVariant visibleValue()
Abstract class for a cell editor. Handles cell painting and displaying the editor widget.
KexiTableViewColumn * column() const