00001 /**************************************************************************** 00002 ** $Id: asqlfield.h,v 1.3 2004/09/01 16:55:58 leader Exp $ 00003 ** 00004 ** Header file of the Ananas database field of Ananas 00005 ** Designer and Engine applications 00006 ** 00007 ** Created : 20031201 00008 ** 00009 ** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved. 00010 ** 00011 ** This file is part of the Library of the Ananas 00012 ** automation accounting system. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00021 ** 00022 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru 00023 ** See http://www.leaderit.ru/gpl/ for GPL licensing information. 00024 ** 00025 ** Contact org@leaderit.ru if any conditions of this licensing are 00026 ** not clear to you. 00027 ** 00028 **********************************************************************/ 00029 00030 #ifndef ASQLFIELD_H 00031 #define ASQLFIELD_H 00032 #include <qsqlfield.h> 00033 #include "acfg.h" 00034 00035 /* 00036 class ANANAS_EXPORT aField : public QObject //SqlField 00037 { 00038 Q_OBJECT 00039 public: 00040 // enum fieldType ( Unknown, Numberic, Character, Date, Object ); 00041 aCfgItem context; 00042 long id; 00043 aCfg *md; 00044 bool fSys; 00045 int Width, Dec; 00046 QString Name; 00047 char aType; 00048 QVariant::Type Type; 00049 00050 00051 // aField( aCfg *newmd, aCfgItem newcontext ); 00052 aField( const QString &fname = QString::null, const QString &ftype = QString::null ); 00053 ~aField(); 00054 00055 // QSqlField *sqlField(); 00056 public slots: 00057 virtual QVariant value(); 00058 virtual void setValue( const QVariant &value); 00059 private: 00060 QVariant field; 00061 }; 00062 */ 00063 00064 class ANANAS_EXPORT aSQLField: public QObject //aField 00065 { 00066 Q_OBJECT 00067 public: 00068 QString tName; 00069 QWidget *editorWidget; 00070 00071 aSQLField( aCfg *newmd, aCfgItem newcontext ); 00072 aSQLField( const QString &name = QString::null, const QString &type = QString::null, const QString &tname = QString::null ); 00073 ~aSQLField(); 00074 00075 QSqlField *sqlField(); 00076 virtual QWidget *editor(); 00077 00078 public slots: 00079 virtual QVariant value(); 00080 virtual void setValue( const QVariant &value); 00081 private: 00082 QSqlField *field; 00083 }; 00084 00085 #endif