umbrello API Documentation

UMLEnum Class Reference

This class contains the non-graphical information required for a UML Enum. Non-graphical Information for an Enum. More...

#include <enum.h>

Inheritance diagram for UMLEnum:

UMLClassifier UMLPackage UMLCanvasObject UMLObject List of all members.

Signals

void enumLiteralAdded (UMLClassifierListItem *)
void enumLiteralRemoved (UMLClassifierListItem *)

Public Member Functions

 UMLEnum (const QString &name="", Uml::IDType id=Uml::id_None)
 Sets up an enum.
virtual ~UMLEnum ()
 Standard deconstructor.
bool operator== (UMLEnum &rhs)
 Overloaded '==' operator.
virtual void copyInto (UMLEnum *rhs) const
 Copy the internal presentation of this object into the new object.
virtual UMLObjectclone () const
 Make a clone of this object.
UMLObjectcreateEnumLiteral ()
 Creates a literal for the enum.
UMLObjectaddEnumLiteral (const QString &name, Uml::IDType id=Uml::id_None)
 Adds an enumliteral to the enum.
bool addEnumLiteral (UMLEnumLiteral *Att, IDChangeLog *Log=0)
 Adds an already created enumliteral.
bool addEnumLiteral (UMLEnumLiteral *Att, int position)
 Adds an enumliteral to the enum, at the given position.
int removeEnumLiteral (UMLEnumLiteral *a)
 Removes an enumliteral from the class.
int enumLiterals ()
 Returns the number of enumliterals for the class.
void signalEnumLiteralRemoved (UMLClassifierListItem *elit)
 Emit the enumLiteralRemoved signal.
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 Creates the <UML:Enum> element including its enumliterals.

Protected Member Functions

bool load (QDomElement &element)
 Loads the <UML:Enum> element including its enumliterals.

Detailed Description

This class contains the non-graphical information required for a UML Enum. Non-graphical Information for an Enum.

This class inherits from UMLClassifier which contains most of the information.

Author:
Jonathan Riddell Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 29 of file enum.h.


Constructor & Destructor Documentation

UMLEnum::UMLEnum const QString &  name = "",
Uml::IDType  id = Uml::id_None
[explicit]
 

Sets up an enum.

Parameters:
name The name of the Enum.
id The unique id of the Enum.

Definition at line 24 of file enum.cpp.

References UMLPackage::init().

Referenced by clone().

UMLEnum::~UMLEnum  )  [virtual]
 

Standard deconstructor.

Definition at line 28 of file enum.cpp.


Member Function Documentation

bool UMLEnum::operator== UMLEnum rhs  ) 
 

Overloaded '==' operator.

Definition at line 32 of file enum.cpp.

References UMLClassifier::operator==().

void UMLEnum::copyInto UMLEnum rhs  )  const [virtual]
 

Copy the internal presentation of this object into the new object.

Definition at line 36 of file enum.cpp.

References UMLClassifier::copyInto().

Referenced by clone().

UMLObject * UMLEnum::clone  )  const [virtual]
 

Make a clone of this object.

Reimplemented from UMLClassifier.

Definition at line 41 of file enum.cpp.

References clone(), copyInto(), and UMLEnum().

Referenced by clone().

UMLObject * UMLEnum::createEnumLiteral  ) 
 

Creates a literal for the enum.

Returns:
The UMLEnum created

Definition at line 54 of file enum.cpp.

References addEnumLiteral(), UMLApp::getDocument(), UMLObject::getName(), UMLEnumLiteral::showPropertiesDialog(), UMLDoc::signalUMLObjectCreated(), and UMLCanvasObject::uniqChildName().

UMLObject * UMLEnum::addEnumLiteral const QString &  name,
Uml::IDType  id = Uml::id_None
 

Adds an enumliteral to the enum.

Parameters:
name The name of the enumliteral.
id The id of the enumliteral (optional.) If omitted a new ID is assigned internally.
Returns:
Pointer to the UMLEnumliteral created.

Definition at line 83 of file enum.cpp.

References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), and UMLObject::modified().

Referenced by createEnumLiteral().

bool UMLEnum::addEnumLiteral UMLEnumLiteral Att,
IDChangeLog Log = 0
 

Adds an already created enumliteral.

The enumliteral object must not belong to any other concept.

Parameters:
Att Pointer to the UMLEnumLiteral.
Log Pointer to the IDChangeLog.
Returns:
True if the enumliteral was successfully added.

Definition at line 98 of file enum.cpp.

References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), UMLObject::getName(), and UMLObject::modified().

bool UMLEnum::addEnumLiteral UMLEnumLiteral Att,
int  position
 

Adds an enumliteral to the enum, at the given position.

If position is negative or too large, the enumliteral is added to the end of the list.

Parameters:
Att Pointer to the UMLEnumLiteral.
position Position index for the insertion.
Returns:
True if the enumliteral was successfully added.

Definition at line 115 of file enum.cpp.

References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), UMLObject::getName(), and UMLObject::modified().

int UMLEnum::removeEnumLiteral UMLEnumLiteral a  ) 
 

Removes an enumliteral from the class.

Parameters:
a The enumliteral to remove.
Returns:
Count of the remaining enumliterals after removal. Returns -1 if the given enumliteral was not found.

Definition at line 133 of file enum.cpp.

References UMLObject::emitModified().

Referenced by UMLDoc::removeUMLObject().

int UMLEnum::enumLiterals  ) 
 

Returns the number of enumliterals for the class.

Returns:
The number of enumliterals for the class.

Definition at line 147 of file enum.cpp.

Referenced by saveToXMI().

void UMLEnum::signalEnumLiteralRemoved UMLClassifierListItem elit  ) 
 

Emit the enumLiteralRemoved signal.

Definition at line 151 of file enum.cpp.

Referenced by UMLClassifier::takeItem().

void UMLEnum::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Creates the <UML:Enum> element including its enumliterals.

Reimplemented from UMLClassifier.

Definition at line 155 of file enum.cpp.

References enumLiterals(), UMLClassifier::getFilteredList(), UMLObject::save(), and UMLObject::saveToXMI().

bool UMLEnum::load QDomElement &  element  )  [protected, virtual]
 

Loads the <UML:Enum> element including its enumliterals.

Reimplemented from UMLClassifier.

Definition at line 167 of file enum.cpp.

References UMLObject::loadFromXMI().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:07 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003