00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SUBFORM_H
00023 #define SUBFORM_H
00024
00025 #include <Qt>
00026
00027 #include "postgresiface2.h"
00028 #include "funcaux.h"
00029 #include "qtable2.h"
00030 #include "dbrecord.h"
00031
00032
00033 class SHeader {
00034 public:
00035 enum dboptions {DBNone = 0, DBReadOnly = 1, DBNoView = 2, DBNoWrite = 4, DBBlockView = 8};
00036
00037 protected:
00038 QString m_nomcampo;
00039 QString m_valorcampo;
00040 QString m_nompresentacion;
00041 unsigned int m_restricciones;
00042 DBCampo::dbtype m_tipo;
00043 unsigned int m_options;
00044
00045 public:
00046 SHeader(QString nom, DBCampo::dbtype typ, int res, int opt, QString nomp = "");
00047 ~SHeader();
00048 int set(QString val);
00049 unsigned int options();
00050 unsigned int restricciones();
00051 DBCampo::dbtype tipo();
00052 QString nompresentacion();
00053 int restrictcampo();
00054 QString nomcampo();
00055 };
00056
00057
00058 class SDBRecord: public DBRecord {
00059 public:
00060 SDBRecord(postgresiface2 *con);
00061 ~SDBRecord();
00062 int addDBCampo(QString nom, DBCampo::dbtype typ, int res, QString nomp = "");
00063 void refresh();
00064 virtual int DBsave(QString &);
00065 };
00066
00067
00068 class SDBCampo: public QTableWidgetItem2, public DBCampo {
00069 private:
00070 SDBRecord *m_pare;
00071
00072 public:
00073 SDBRecord *pare();
00074 SDBCampo(SDBRecord *par, postgresiface2 *com, QString nom, dbtype typ, int res, QString nomp = "");
00075 virtual ~SDBCampo();
00076 int addDBCampo(QString nom, DBCampo::dbtype typ, int res, QString nomp = "");
00077 virtual int set(QString val);
00078 void refresh();
00079 virtual bool operator< (const QTableWidgetItem &other);
00080 };
00081
00082 #endif
00083