kexi

kexiinputtableedit.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 Lucijan Busch <lucijan@gmx.at>
3 Copyright (C) 2003-2007 Jaroslaw Staniek <js@iidea.pl>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef KEXIINPUTTABLEEDIT_H
22#define KEXIINPUTTABLEEDIT_H
23
24#include <klineedit.h>
25#include <tqvariant.h>
26
27#include "kexitableedit.h"
28#include "kexicelleditorfactory.h"
29#include "kexitextformatter.h"
30
33class KEXIDATATABLE_EXPORT KexiInputTableEdit : public KexiTableEdit
34{
35 TQ_OBJECT
36
37
38 public:
39 KexiInputTableEdit(KexiTableViewColumn &column, TQWidget *parent=0);
40
41 virtual ~KexiInputTableEdit();
42
43#if 0
44//moved to KexiTextFormatter
48 static TQString valueToText(KexiDB::Field* field, const TQVariant& value, const TQString& add);
49#endif
50
51 virtual bool valueChanged();
52
54 virtual bool valueIsNull();
55
59 virtual bool valueIsEmpty();
60
61 virtual TQVariant value();
62
63 virtual bool cursorAtStart();
64 virtual bool cursorAtEnd();
65
66// virtual bool eventFilter(TQObject* watched, TQEvent* e);
67//js void end(bool mark);
68//js void backspace();
69 virtual void clear();
70
72 virtual TQSize totalSize();
73
76 virtual void handleAction(const TQString& actionName);
77
81 virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue);
82
90 virtual bool showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, const TQFontMetrics& fm,
91 bool focused);
92
93 public slots:
95 virtual void moveCursorToEnd();
96
98 virtual void moveCursorToStart();
99
101 virtual void selectAll();
102
103 protected slots:
104 void setRestrictedCompletion();
105 void completed(const TQString &);
106
107 protected:
109 virtual void setValueInternal(const TQVariant& add, bool removeOld);
110
111 void showHintButton();
112 void init();
113 virtual void paintEvent( TQPaintEvent *e );
114
115 KexiTextFormatter m_textFormatter;
116 bool m_calculatedCell;
117 TQString m_decsym;
118 TQString m_origText;
119 KLineEdit *m_lineedit;
120
121 signals:
122 void hintClicked();
123};
124
125KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiInputEditorFactoryItem)
126
127#endif
Meta-data for a field.
Definition field.h:73
virtual bool cursorAtEnd()=0
virtual bool cursorAtStart()=0
virtual TQVariant value()=0
virtual bool valueIsNull()=0
virtual bool valueIsEmpty()=0
virtual void handleAction(const TQString &actionName)
virtual void setValueInternal(const TQVariant &add, bool removeOld)=0
virtual void clear()=0
clears item's data, so the data will contain NULL data
virtual TQVariant visibleValue()
TQString m_origText
decimal symbol
KLineEdit * m_lineedit
orig. Line Edit's text after conversion - for easy comparing
virtual TQVariant value()
virtual TQSize totalSize()
KexiTableViewColumn * column() const
virtual bool showToolTipIfNeeded(const TQVariant &value, const TQRect &rect, const TQFontMetrics &fm, bool focused)
virtual KexiDB::Field * field() const
virtual void handleCopyAction(const TQVariant &value, const TQVariant &visibleValue)=0
Text formatter used to format TQVariant values to text for displaying and back to TQVariant.