kexidbtimeedit.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 KexiDBTimeEdit_H
22#define KexiDBTimeEdit_H
23
24#include "kexiformdataiteminterface.h"
25#include "kexidbtextwidgetinterface.h"
26#include <tqdatetimeedit.h>
27
28class TQDateTimeEditor;
29
31class KEXIFORMUTILS_EXPORT KexiDBTimeEdit : public TQTimeEdit, public KexiFormDataItemInterface
32{
33 TQ_OBJECT
34
35 TQ_PROPERTY(TQString dataSource READ dataSource WRITE setDataSource DESIGNABLE true)
36 TQ_PROPERTY(TQCString dataSourceMimeType READ dataSourceMimeType WRITE setDataSourceMimeType DESIGNABLE true)
37 TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true )
38
39 public:
40 KexiDBTimeEdit(const TQTime &time, TQWidget *parent, const char *name=0);
41 virtual ~KexiDBTimeEdit();
42
43 inline TQString dataSource() const { return KexiFormDataItemInterface::dataSource(); }
44 inline TQCString dataSourceMimeType() const { return KexiFormDataItemInterface::dataSourceMimeType(); }
45 virtual TQVariant value();
46 virtual void setInvalidState( const TQString& displayText );
47
50 virtual bool valueIsNull();
51
56 virtual bool valueIsEmpty();
57
59 virtual bool isReadOnly() const;
60
62 virtual TQWidget* widget();
63
64 virtual bool cursorAtStart();
65 virtual bool cursorAtEnd();
66 virtual void clear();
67
68 virtual void setEnabled(bool enabled);
69
70 public slots:
71 inline void setDataSource(const TQString &ds) { KexiFormDataItemInterface::setDataSource(ds); }
72 inline void setDataSourceMimeType(const TQCString &ds) { KexiFormDataItemInterface::setDataSourceMimeType(ds); }
73 virtual void setReadOnly(bool set);
74
75 protected slots:
76 void slotValueChanged(const TQTime&);
77
78 protected:
79 virtual void setValueInternal(const TQVariant& add, bool removeOld);
80
81 private:
82 TQDateTimeEditor* m_dte_time;
83 bool m_invalidState : 1;
84 bool m_cleared : 1;
85 bool m_readOnly : 1;
86};
87
88#endif
A db-aware time editor.
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