kexi

kexidatetimetableedit.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002   Lucijan Busch <lucijan@gmx.at>
00003    Copyright (C) 2003   Daniel Molkentin <molkentin@kde.org>
00004    Copyright (C) 2003-2004,2006 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This program is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this program; see the file COPYING.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef KEXIDATETIMETABLEEDIT_H
00023 #define KEXIDATETIMETABLEEDIT_H
00024 
00025 #include "kexidatetableedit.h"
00026 #include "kexitimetableedit.h"
00027 
00034 class KexiDateTimeTableEdit : public KexiInputTableEdit
00035 {
00036     Q_OBJECT
00037 
00038     public:
00039         KexiDateTimeTableEdit(KexiTableViewColumn &column, QWidget *parent=0);
00040         virtual ~KexiDateTimeTableEdit();
00041         virtual void setupContents( QPainter *p, bool focused, const QVariant& val, 
00042             QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00043         virtual QVariant value();
00044         virtual bool valueIsNull();
00045         virtual bool valueIsEmpty();
00046         virtual bool valueIsValid();
00047 
00049         virtual void handleAction(const QString& actionName);
00050 
00052         virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue);
00053 
00054     protected:
00056         void setValueInInternalEditor(const QVariant &value);
00057         virtual void setValueInternal(const QVariant& add, bool removeOld);
00058         bool textIsEmpty() const;
00059 
00061         KexiDateFormatter m_dateFormatter;
00062 
00064         KexiTimeFormatter m_timeFormatter;
00065 };
00066 
00067 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiDateTimeEditorFactoryItem)
00068 
00069 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys