00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef QSDATA_H
00022 #define QSDATA_H
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027
00028 #include"qsgattr.h"
00029 #include"qsmatrix.h"
00030 #include"qsserializable.h"
00031 #include<qobject.h>
00032 #include<qstring.h>
00033 #include<math.h>
00034
00035
00036
00052 class QSData : public QObject, public QSSerializable
00053 {
00054 Q_OBJECT
00055
00056 public:
00060 enum ColumnType {
00061 ColumnUnknown = 0,
00062 ColumnX,
00063 ColumnY,
00064 ColumnZ,
00065 ColumnV,
00066 ColumnDX,
00067 ColumnDY,
00068 ColumnSize,
00069 ColumnWidth,
00070 ColumnLineStyle,
00071 ColumnFillStyle,
00072 ColumnPointStyle,
00073 ColumnPointFill,
00074 ColumnArrowStyle,
00075 ColumnFontFamily,
00076 ColumnFontSize,
00077 ColumnFontBold,
00078 ColumnFontItalic,
00079 ColumnRed,
00080 ColumnGreen,
00081 ColumnBlue,
00082 ColumnAlpha,
00083 ColumnByte,
00084 ColumnInt,
00085 ColumnBool,
00086 ColumnString
00087 };
00091 QSData( QObject *parent=NULL, QSData *parentObject=NULL, const char *name=0 );
00095 virtual ~QSData();
00099 virtual void setObjectName( const char *name );
00103 const char *objectName() const { return name(); }
00107 virtual bool setMatrix( int channel, QSMatrix *m );
00111 virtual QSMatrix *matrix( int channel ) const;
00116 virtual QSMatrix *takeMatrix( int channel, QSMatrix *newMatrix = NULL );
00120 virtual void deleteMatrix( int channel );
00124 virtual int channelCount() const;
00133 virtual void dataChanging( int channel = -1 );
00142 virtual void dataChanged( int channel = -1 );
00146 virtual QSData *parentObject() const { return m_parent_object; }
00150 virtual int childCount() const { return 0; }
00154 virtual QSData *child( int index ) const { return NULL; }
00158 virtual int childIndex( QSData *child ) const;
00162 virtual QString channelVariable( int channel ) const { return QString::null; }
00167 virtual ColumnType columnType( int channel, int column ) const { return ColumnUnknown; }
00171 virtual void loadStateFromStream( QDataStream& stream, QSObjectFactory *factory );
00175 virtual void saveStateToStream( QDataStream& stream, QSObjectFactory *factory );
00176
00177 signals:
00181 void sigNameChanged( const char *name );
00185 void sigNameChanged( QSData *thisOrChildObject, const char *name );
00189 void sigDataChanged( QSData *thisOrChildObject, int channel );
00193 void sigChildAdded( QSData *newChild );
00197 void sigChildRemoved( QSData *removedChild );
00201 void sigChildOrder();
00205 void sigChildListChanged();
00209 void sigDeleted( QSData *thisObject );
00210
00211 protected:
00216 virtual void dataChanging( QSData *object, int channel = -1 );
00221 virtual void dataChanged( QSData *object, int channel = -1 );
00225 virtual void nameChanged( QSData *object, const char *newName );
00226
00227 QSData *m_parent_object;
00228 };
00229
00230 #endif
00231
00232