kexi
kexidatetableedit.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEXIDATETABLEEDIT_H
00023 #define KEXIDATETABLEEDIT_H
00024
00025 #include <qdatetimeedit.h>
00026
00027 #include "kexiinputtableedit.h"
00028
00030 class KEXIDATATABLE_EXPORT KexiDateFormatter
00031 {
00032 public:
00034 KexiDateFormatter();
00035
00038
00039 ~KexiDateFormatter();
00040
00043 QDate stringToDate( const QString& str ) const;
00044
00047 QString dateToString( const QDate& date ) const;
00048
00051 QString inputMask() const { return m_inputMask; }
00052
00053 QString separator() const { return m_separator; }
00054
00055 protected:
00057 QString m_inputMask;
00058
00060 QDateEdit::Order m_order;
00061
00063 bool m_longYear;
00064
00065 bool m_monthWithLeadingZero, m_dayWithLeadingZero;
00066
00068 QString m_qtFormat;
00069
00071 int m_yearpos, m_monthpos, m_daypos;
00072
00073 QString m_separator;
00074 };
00075
00082 class KEXIDATATABLE_EXPORT KexiDateTableEdit : public KexiInputTableEdit
00083 {
00084 Q_OBJECT
00085
00086 public:
00087 KexiDateTableEdit(KexiTableViewColumn &column, QScrollView *parent=0);
00088 virtual ~KexiDateTableEdit();
00089 virtual void setupContents( QPainter *p, bool focused, QVariant val,
00090 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00091 virtual QVariant value();
00092 virtual bool valueIsNull();
00093 virtual bool valueIsEmpty();
00094 virtual bool valueIsValid();
00095
00096 protected:
00097 virtual void setValueInternal(const QVariant& add, bool removeOld);
00098 QDate dateValue() const;
00099
00101 KexiDateFormatter m_formatter;
00102 };
00103
00104 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiDateEditorFactoryItem)
00105
00106 #endif
|