kexi
kexitimetableedit.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXITIMETABLEEDIT_H
00021 #define KEXITIMETABLEEDIT_H
00022
00023 #include <qregexp.h>
00024
00025 #include "kexiinputtableedit.h"
00026
00030 class KEXIDATATABLE_EXPORT KexiTimeFormatter
00031 {
00032 public:
00034 KexiTimeFormatter();
00035
00038
00039 ~KexiTimeFormatter();
00040
00043 QTime stringToTime( const QString& str );
00044
00047 QString timeToString( const QTime& time ) const;
00048
00051 QString inputMask() const { return m_inputMask; }
00052
00053 protected:
00055 QString m_inputMask;
00056
00057
00058
00059
00061 bool m_24h;
00062
00063 bool m_hoursWithLeadingZero;
00064
00066 QString m_outputFormat;
00067
00069 int m_hourpos, m_minpos, m_secpos, m_ampmpos;
00070
00071 QRegExp m_hmsRegExp, m_hmRegExp;
00072 };
00073
00080 class KEXIDATATABLE_EXPORT KexiTimeTableEdit : public KexiInputTableEdit
00081 {
00082 Q_OBJECT
00083
00084 public:
00085 KexiTimeTableEdit(KexiTableViewColumn &column, QScrollView *parent=0);
00086 virtual ~KexiTimeTableEdit();
00087 virtual void setupContents( QPainter *p, bool focused, QVariant val,
00088 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00089 virtual QVariant value();
00090 virtual bool valueIsNull();
00091 virtual bool valueIsEmpty();
00092 virtual bool valueIsValid();
00093
00094 protected:
00095 virtual void setValueInternal(const QVariant& add, bool removeOld);
00096 QTime timeValue();
00097
00099 KexiTimeFormatter m_formatter;
00100 };
00101
00102 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiTimeEditorFactoryItem)
00103
00104 #endif
|