Source: ./conceptwidget.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
 *                                                                         *
 *   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 CONCEPTWIDGET_H
#define CONCEPTWIDGET_H

#include "umlwidget.h"
#include "attribute.h"
#include "operation.h"
#include 
#include "listpopupmenu.h"
#include "conceptwidgetdata.h"

class UMLView;

#define MARGIN 5

/**
 *	Defines a graphical version of the Concept/Class.  Most of the functionality
 *	will come from the @ref UMLWidget class from which class inherits from.
 *
 *	@short	A graphical version of a Concept/Class.
 *	@author Paul Hensgen	
 *	@version	1.0
 *	@see	UMLWidget
 */
class ConceptWidget : public UMLWidget {
public:
	/**
	 *	Constructs a ConceptWidget.
	 *
	 *	@param	view		The parent of this ConceptWidget.
	 *	@param	pData		The ConceptWidgetData to represent.
	 */
	ConceptWidget(UMLView * view, UMLObject *o, UMLWidgetData *pData);

	/**
	 *	Constructs a ConceptWidget.
	 *
	 *	@param	view		The parent of this ConceptWidget.
	 *	@param	o				The UMLObject is will be representing.
	 */
	ConceptWidget(UMLView * view, UMLObject *o);

	/**
	 *	Constructs a ConceptWidget.
	 *
	 *	@param	view	The parent of this ConceptWidget.
	 */
	ConceptWidget(UMLView * view);

	/**
	 *	Standard deconstructor.
	 */
	~ConceptWidget();

	/**
	 *	Initializes key variables of the class.
	 */
	void init();

	/**
	 *	Returns the status of showing attributes.
	 *
	 *	@return	Returns the status of showing attributes.
	 */
	bool getShowAtts() {
		return ((ConceptWidgetData*)m_pData)->m_bShowAttributes;
	}

	/**
	 *	Return the status of showing operations.
	 *
	 *	@return	Return the status of showing operations.
	 */
	bool getShowOps() {
		return ((ConceptWidgetData*)m_pData)->m_bShowOperations;
	}

	/**
	 *	Return the status of showing operation signatures.
	 *
	 *	@return Returns the status of showing operation signatures.
	 */
	Uml::Signature_Type getShowOpSigs() {
		return ((ConceptWidgetData*)m_pData)->m_ShowOpSigs;
	}

	/**
	 *	Returns the status of showing attribute signatures.
	 *
	 *	@return	Returns the status of showing attribute signatures.
	 */
	Uml::Signature_Type getShowAttSigs() {
		return ((ConceptWidgetData*)m_pData)->m_ShowAttSigs;
	}

	/**
	 *	Returns the status of whether to show scope.
	 *
	 *	@return  Returns the status of whether to show scope.
	 */
	bool getShowScope() {
		return ((ConceptWidgetData*)m_pData)->m_bShowScope;
	}

	/**
	 *	Set the status of whether to show scope
	 *
	 *	@param	_scope Status to whether to show scope.
	 */
	void setShowScope(bool _scope);

	/**
	 * 	Set the status of whether to show Attributes
	 *
	 *	@param _show  The status of whether to show Attributes
	 */
	void setShowAtts(bool _show);

	/**
	 * 	Set the status of whether to show Attribute signature
	 *
	 *	@param _show  The status of whether to show Attribute signature
	 */
	void setShowAttSigs(bool _show);

	/**
	 * 	Set the status of whether to show Operation signature
	 *
	 *	@param _show  The status of whether to show Operation signature
	 */
	void setShowOpSigs(bool _show);

	/**
	 * 	Set the status of whether to show Operations
	 *
	 *	@param _show  The status of whether to show Operations
	 */
	void setShowOps(bool _show);

	/**
	 *	Set the type of signature to display for an Operation
	 *
	 *	@param	sig	the type of signature to display for an Operation
	 */
	void setOpSignature(Uml::Signature_Type sig);

	/**
	 *	Set the type of signature to display for an Attribute
	 *
	 *	@param	sig	the type of signature to display for an Attribute
	 */
	void setAttSignature(Uml::Signature_Type sig);

	/**
	 *	Returns the status of whether to show StereoType.
	 *
	 *	@return  Returns the status of whether to show StereoType.
	 */
	bool getShowStereotype() {
		return ((ConceptWidgetData*)m_pData)->m_bShowStereotype;
	}

	/**
	 *	Returns the status of whether to show Package.
	 *
	 *	@return  Returns the status of whether to show Package.
	 */
	bool getShowPackage() {
		return ((ConceptWidgetData*)m_pData)->m_bShowPackage;
	}

	/**
	 * 	Set the status of whether to show StereoType
	 *
	 *	@param _show  The status of whether to show StereoType
	 */
	void setShowStereotype(bool _status);

	/**
	 * 	Set the status of whether to show Package
	 *
	 *	@param _show  The status of whether to show Package
	 */
	void setShowPackage(bool _status);

	/**
	 * Activate the object after serializing it from a QDataStream
	 */
	virtual bool Activate(IDChangeLog* ChangeLog  = 0 );

	/**
	 * Synchronizes the Widget's m_pData member with its display properties, for example:
	 * the X and Y positions of the widget, etc
	 */
	virtual void SynchronizeData();

	/**
	 *	Overrides standards method
	 */
	void draw(QPainter & p, int offsetX, int offsetY);
private:

	/**
	 *	Automatically calculates the size of the object.
	 */
	void calculateSize();

	void updateSigs();

	ListPopupMenu *m_pMenu;

public slots:
	/**
	 *	Will be called when a menu selection has been made from the popup menu.
	 *
	 *	@param	sel	The selection id that has been selected.
	 */
	void slotMenuSelection(int sel);
};

#endif

Generated by: jr on radge on Wed Sep 25 00:11:47 2002, using kdoc 2.0a54.