Source: ./associationwidgetdata.h
|
|
|
|
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef ASSOCIATIONWIDGETDATA_H
#define ASSOCIATIONWIDGETDATA_H
#include
#include "umlnamespace.h"
#include "linepath.h"
#include
class FloatingTextData;
/**
* This class holds all the information
* from an association
* @author Gustavo Madrigal
*/
class AssociationWidgetData {
friend class AssociationWidget;
friend class LinePath;
public:
/**
* Constructor
*/
AssociationWidgetData( );
/**
* Deconstructor
*/
virtual ~AssociationWidgetData();
/**
* Copy Constructor
*/
AssociationWidgetData(AssociationWidgetData & Other);
/**
* Overloaded '=' operator
*/
virtual AssociationWidgetData & operator=(AssociationWidgetData & Other);
/**
* Overloaded '==' operator
*/
virtual bool operator==(AssociationWidgetData & Other);
/**
* Save/load data
*/
virtual bool serialize(QDataStream *s, bool archive);
/**
* Returns the amount of bytes needed to serialize this object
* If the serialization method of this class is changed this function will have to be CHANGED TOO
* This function is used by the Copy and Paste Functionality
* The Size in bytes of a serialized QString Object is long sz:
* if ( (sz =str.length()*sizeof(QChar)) && !(const char*)str.unicode() )
* {
* sz = size of Q_UINT32; // typedef unsigned int Q_UINT32; // 32 bit unsigned
* }
* This calculation is valid only for QT 2.1.x or
* superior, this is totally incompatible with QT 2.0.x
* or QT 1.x or inferior
* That means the copy and paste functionality will work on with QT 2.1.x or superior
*/
virtual long getClipSizeOf();
/**
* Write property of FloatingTextData* m_pMultiDataA.
*/
virtual void setMultiDataA( FloatingTextData* pMultiData);
/**
* Read property of FloatingTextData* m_pMultiDataA.
*/
virtual FloatingTextData* getMultiDataA();
/**
* Write property of FloatingTextData* m_pMultiDataB.
*/
virtual void setMultiDataB( FloatingTextData* pData);
/**
* Read property of FloatingTextData* m_pMultiDataB.
*/
virtual FloatingTextData* getMultiDataB();
/**
* Write property of FloatingTextData* m_pRoleData.
*/
virtual void setRoleData( FloatingTextData* pData);
/**
* Read property of FloatingTextData* m_pRoleData.
*/
virtual FloatingTextData* getRoleData();
/**
* Write property of AssociationType AssocType.
*/
virtual void setAssocType( Uml::Association_Type Type);
/**
* Read property of AssociationType AssocType.
*/
virtual Uml::Association_Type getAssocType();
/**
* Write property of int m_nWidgetAID.
*/
virtual void setWidgetAID( int AID);
/**
* Read property of int m_nWidgetAID.
*/
virtual int getWidgetAID();
/**
* Write property of int m_nWidgetBID.
*/
virtual void setWidgetBID( int BID);
/**
* Read property of int m_nWidgetBID.
*/
virtual int getWidgetBID();
/**
* Prints the association's data to stderr
*/
void print2cerr();
/**
* Sets the Association line index for widgetA
*/
void setIndexA(int index) {
m_nIndexA = index;
}
/**
* Returns the Association line index for widgetA
*/
int getIndexA() {
return m_nIndexA;
}
/**
* Sets the Association line index for widgetB
*/
void setIndexB(int index) {
m_nIndexB = index;
}
/**
* Returns the Association line index for widgetB
*/
int getIndexB() {
return m_nIndexB;
}
/**
* Sets the total count on the Association region for widgetA
*/
void setTotalCountA(int count) {
m_nTotalCountA = count;
}
/**
* Returns the total count on the Association region for widgetA
*/
int getTotalCountA() {
return m_nTotalCountA;
}
/**
* Sets the total count on the Association region for widgetB
*/
void setTotalCountB(int count) {
m_nTotalCountB = count;
}
/**
* Region the total count on the Association region for widgetB
*/
int getTotalCountB() {
return m_nTotalCountB;
}
/**
* Returns the associations documentation.
*/
QString getDoc() {
return m_Doc;
}
/**
* Sets the associations documentation.
*/
void setDoc( QString doc) {
m_Doc = doc;
}
bool saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
bool loadFromXMI( QDomElement & qElement );
void cleanup();
protected:
/**
* The Data from the Multiplicity Text widget at the starting side of the association
*/
FloatingTextData* m_pMultiDataA;
/**
* The Data from the Multiplicity Text widget at the ending side of the association
*/
FloatingTextData* m_pMultiDataB;
/**
* The Data from the Association's Role FloatingText widget
*/
FloatingTextData* m_pRoleData;
/**
* This is the type of the association
*/
Uml::Association_Type m_AssocType;
/**
* The definition points for the association line
*/
LinePath m_LinePath;
/**
* This member holds the identification number the the UMLWidget at the starting side
* of the association
*/
int m_nWidgetAID;
/**
* This member holds the identification number the the UMLWidget at the ending side
* of the association
*/
int m_nWidgetBID;
/**
* The index of where the line is on the region for widget a
*/
int m_nIndexA;
/**
* The index of where the line is on the region for widget b
*/
int m_nIndexB;
/**
* The total amount of associations on the region widget a line is on.
*/
int m_nTotalCountA;
/**
* The total amount of associations on the region widget b line is on.
*/
int m_nTotalCountB;
/**
* The documentation for the association.
*/
QString m_Doc;
};
#endif
| Generated by: jr on radge on Wed Sep 25 00:11:47 2002, using kdoc 2.0a54. |