Ananas Library  0.9.5
adatafield.h
1 /****************************************************************************
2 ** $Id: adatafield.h,v 1.7 2006/08/23 07:46:57 app Exp $
3 **
4 ** Header file of the Ananas data field of Ananas
5 ** Designer and Engine applications
6 **
7 ** Created : 20031201
8 **
9 ** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10 **
11 ** This file is part of the Library of the Ananas
12 ** automation accounting system.
13 **
14 ** This file may be distributed and/or modified under the terms of the
15 ** GNU General Public License version 2 as published by the Free Software
16 ** Foundation and appearing in the file LICENSE.GPL included in the
17 ** packaging of this file.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23 ** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24 **
25 ** Contact org@leaderit.ru if any conditions of this licensing are
26 ** not clear to you.
27 **
28 **********************************************************************/
29 
30 #ifndef ADATAFIELD_H
31 #define ADATAFIELD_H
32 //#include <qsqlfield.h>
33 
34 #include <qobject.h>
35 #include <qvariant.h>
36 #include "ananasglobal.h"
37 #include "acfg.h"
38 
39 
40 //class aCfg;
41 //class aCfgItem;
42 //class QObject;
43 //#define
44 
60 class ANANAS_EXPORT aDataField : public QObject
61 {
62  Q_OBJECT
63 // Q_PROPERTY( Priority priority READ priority WRITE setPriority )
64 // Q_ENUMS( Priority )
65 // Q_CLASSINFO( "Author", "Oscar Peterson")
66 public:
67 // enum fieldType ( Unknown, Numberic, Character, Date, Object );
68  aCfgItem context;
69  long id;
70  aCfg *md;
71  bool fSys;
72  int Width, Dec;
73  QString Name, fType;
74  char aType;
75  QVariant::Type Type;
76 // QVariant field;
77  int oType;
78 
79 
80 // aField( aCfg *newmd, aCfgItem newcontext );
81  aDataField( QObject *parent, const QString &fname = QString::null, const QString &ftype = QString::null );
82  aDataField( const QString &fname = QString::null, const QString &ftype = QString::null );
83  aDataField( const aDataField &field );
84  ~aDataField();
85 
86  aDataField& operator=( const aDataField& other );
87  bool operator==( const aDataField& other ) const;
88  bool operator!=( const aDataField& other ) const;
89 // aDataField& operator[]( const int& i ){};
90 
91 // QSqlField *sqlField();
92  virtual QVariant internalValue();
93  virtual void setInternalValue( const QVariant &value);
94 public slots:
95  virtual QString fieldName() const;
96  virtual int ObjectType();
97  virtual QVariant value();
98  virtual void setValue( const QVariant &value);
99 private:
100  QVariant fieldData;
101 
102  void init( const QString &fname = QString::null, const QString &ftype = QString::null );
103 };
104 
105 
106 #endif
Definition: acfg.h:436
Definition: adatafield.h:60