kexidbdoublespinbox.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004-2005 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 KexiDBDoubleSpinBox_H
22#define KexiDBDoubleSpinBox_H
23
24#include "kexiformdataiteminterface.h"
25#include <tqwidget.h>
26#include <knuminput.h>
27
29class KEXIFORMUTILS_EXPORT KexiDBDoubleSpinBox : public KDoubleSpinBox, public KexiFormDataItemInterface
30{
31 TQ_OBJECT
32
33 TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
34 TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
35 TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
36
37 public:
38 KexiDBDoubleSpinBox(TQWidget *parent, const char *name=0);
39 virtual ~KexiDBDoubleSpinBox();
40
41 inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
42 inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
43 virtual TQVariant value();
44 virtual void setInvalidState( const TQString& displayText );
45
48 virtual bool valueIsNull();
49
54 virtual bool valueIsEmpty();
55
57 virtual bool isReadOnly() const;
58
60 virtual TQWidget* widget();
61
62 virtual bool cursorAtStart();
63 virtual bool cursorAtEnd();
64 virtual void clear();
65
66 public slots:
67 virtual void setEnabled(bool enabled);
68 inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
69 inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
70 void slotValueChanged();
71 virtual void setReadOnly(bool set);
72
73 protected:
74 virtual void setValueInternal(const TQVariant& add, bool removeOld);
75
76 private:
77 bool m_invalidState : 1;
78};
79
80#endif
A db-aware int spin box.
virtual bool cursorAtEnd()=0
virtual bool cursorAtStart()=0
virtual bool isReadOnly() const
virtual TQVariant value()=0
virtual bool valueIsNull()=0
virtual bool valueIsEmpty()=0
virtual void setValueInternal(const TQVariant &add, bool removeOld)=0
virtual void clear()=0
clears item's data, so the data will contain NULL data
An interface for declaring form widgets to be data-aware.
void setDataSourceMimeType(const TQCString &ds)
void setDataSource(const TQString &ds)
Sets the name of the data source for this widget.
virtual void setInvalidState(const TQString &displayText)=0
virtual void setReadOnly(bool readOnly)=0