umbrello: UMLListViewItem Class Reference

umbrello 2.32.1 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
UMLListViewItem Class Reference

Items used by UMLListView. More...

`#include <umllistviewitem.h>`

Inheritance diagram for UMLListViewItem:

## Public Types
enum | ListViewType { lvt_Min = 799, lvt_View = 800, lvt_Logical_View, lvt_UseCase_View, lvt_Logical_Folder, lvt_UseCase_Folder, lvt_UseCase_Diagram, lvt_Collaboration_Diagram, lvt_Class_Diagram, lvt_State_Diagram, lvt_Activity_Diagram, lvt_Sequence_Diagram, lvt_Actor, lvt_UseCase, lvt_Class, lvt_Attribute, lvt_Operation, lvt_Template, lvt_Interface, lvt_Package, lvt_Component_Diagram, lvt_Component_Folder, lvt_Component_View, lvt_Component, lvt_Diagrams, lvt_Artifact, lvt_Deployment_Diagram, lvt_Deployment_Folder, lvt_Deployment_View, lvt_Node, lvt_Datatype, lvt_Datatype_Folder, lvt_Enum, lvt_Entity, lvt_EntityAttribute, lvt_EntityRelationship_Diagram, lvt_EntityRelationship_Folder, lvt_EntityRelationship_Model, lvt_Subsystem, lvt_Model, lvt_EnumLiteral, lvt_UniqueConstraint, lvt_PrimaryKeyConstraint, lvt_ForeignKeyConstraint, lvt_CheckConstraint, lvt_Category, lvt_Port, lvt_Properties, lvt_Properties_AutoLayout, lvt_Properties_Class, lvt_Properties_CodeGeneration, lvt_Properties_CodeImport, lvt_Properties_CodeViewer, lvt_Properties_Font, lvt_Properties_General, lvt_Properties_UserInterface, lvt_Association, lvt_Object_Diagram, lvt_Instance, lvt_InstanteAttribute, lvt_Max, lvt_Unknown = -1 }

## Public Slots
void | slotEditFinished (const QString &newText)

## Public Member Functions
| UMLListViewItem (UMLListView *parent, const QString &name, ListViewType t, UMLObject *o=0)
| UMLListViewItem (UMLListView *parent)
| UMLListViewItem (UMLListViewItem *parent)
| UMLListViewItem (UMLListViewItem *parent, const QString &name, ListViewType t, UMLObject *o=0)
| UMLListViewItem (UMLListViewItem *parent, const QString &name, ListViewType t, Uml::ID::Type id)
| ~UMLListViewItem ()
ListViewType | type () const
void | setID (Uml::ID::Type id)
Uml::ID::Type | ID () const
void | setUMLObject (UMLObject *obj)
UMLObject * | umlObject () const
bool | isOwnParent (Uml::ID::Type listViewItemID)
void | updateObject ()
void | updateFolder ()
void | setText (int column, const QString &text)
void | setText (const QString &text)
QString | getSavedText () const
void | setVisible (bool state)
QString | toolTip ()
void | setIcon (Icon_Utils::IconType iconType)
void | addClassifierListItem (UMLClassifierListItem *child, UMLListViewItem *childItem)
void | deleteChildItem (UMLClassifierListItem *child)
UMLListViewItem * | deepCopy (UMLListViewItem *newParent)
UMLListViewItem * | findUMLObject (const UMLObject *o)
UMLListViewItem * | findChildObject (UMLClassifierListItem *cli)
UMLListViewItem * | findItem (Uml::ID::Type id)
UMLListViewItem * | childItem (int i)
void | saveToXMI1 (QDomDocument &qDoc, QDomElement &qElement)
bool | loadFromXMI1 (QDomElement &qElement)
bool | isOpen ()
void | setOpen (bool state)

## Static Public Member Functions
static QString | toString (ListViewType type)

## Protected Types
typedef QMap< UMLClassifierListItem *, UMLListViewItem * > | ChildObjectMap

## Protected Member Functions
void | init ()
void | cancelRenameWithMsg ()

## Protected Attributes
ListViewType | m_type
Uml::ID::Type | m_id
QPointer< UMLObject > | m_object
QString | m_label
ChildObjectMap | m_comap

## Detailed Description

Items used by UMLListView.

Items used by the class UMLListView. This is needed as the type and object information is required to be stored.

Author
  Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m

See also
  UMLListView Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

## Member Typedef Documentation

## ◆ ChildObjectMap

typedef QMap<UMLClassifierListItem*, UMLListViewItem*> UMLListViewItem::ChildObjectMap
| protected

Auxiliary map of child UMLLisViewItems keyed by UMLClassifierListItem. Used by findChildObject() for efficiency instead of looping using firstChild()/nextSibling() because the latter incur enforceItemVisible() and thus expensive sorting.

## Member Enumeration Documentation

## ◆ ListViewType

enum UMLListViewItem::ListViewType

Enumerator
lvt_Min |
lvt_View |
lvt_Logical_View |
lvt_UseCase_View |
lvt_Logical_Folder |
lvt_UseCase_Folder |
lvt_UseCase_Diagram |
lvt_Collaboration_Diagram |
lvt_Class_Diagram |
lvt_State_Diagram |
lvt_Activity_Diagram |
lvt_Sequence_Diagram |
lvt_Actor |
lvt_UseCase |
lvt_Class |
lvt_Attribute |
lvt_Operation |
lvt_Template |
lvt_Interface |
lvt_Package |
lvt_Component_Diagram |
lvt_Component_Folder |
lvt_Component_View |
lvt_Component |
lvt_Diagrams |
lvt_Artifact |
lvt_Deployment_Diagram |
lvt_Deployment_Folder |
lvt_Deployment_View |
lvt_Node |
lvt_Datatype |
lvt_Datatype_Folder |
lvt_Enum |
lvt_Entity |
lvt_EntityAttribute |
lvt_EntityRelationship_Diagram |
lvt_EntityRelationship_Folder |
lvt_EntityRelationship_Model |
lvt_Subsystem |
lvt_Model |
lvt_EnumLiteral |
lvt_UniqueConstraint |
lvt_PrimaryKeyConstraint |
lvt_ForeignKeyConstraint |
lvt_CheckConstraint |
lvt_Category |
lvt_Port |
lvt_Properties |
lvt_Properties_AutoLayout |
lvt_Properties_Class |
lvt_Properties_CodeGeneration |
lvt_Properties_CodeImport |
lvt_Properties_CodeViewer |
lvt_Properties_Font |
lvt_Properties_General |
lvt_Properties_UserInterface |
lvt_Association |
lvt_Object_Diagram |
lvt_Instance |
lvt_InstanteAttribute |
lvt_Max |
lvt_Unknown |

## Constructor & Destructor Documentation

## ◆ UMLListViewItem() [1/5]

UMLListViewItem::UMLListViewItem | ( | UMLListView * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | UMLObject * | o = `0`
| ) |  |

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  o | The object it represents.

## ◆ UMLListViewItem() [2/5]

UMLListViewItem::UMLListViewItem | ( | UMLListView * | parent | ) |
| explicit

Sets up an instance for subsequent loadFromXMI1().

Parameters

  parent | The parent to this instance.

## ◆ UMLListViewItem() [3/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent | ) |
| explicit

Sets up an instance for subsequent loadFromXMI1().

Parameters

  parent | The parent to this instance.

## ◆ UMLListViewItem() [4/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | UMLObject * | o = `0`
| ) |  |

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  o | The object it represents.

## ◆ UMLListViewItem() [5/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | Uml::ID::Type | id
| ) |  |

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  id | The id of this instance.

## ◆ ~UMLListViewItem()

UMLListViewItem::~UMLListViewItem | ( |  | ) |

Standard destructor.

## Member Function Documentation

## ◆ addClassifierListItem()

void UMLListViewItem::addClassifierListItem | ( | UMLClassifierListItem * | child,
|  | UMLListViewItem * | childItem
| ) |  |

Adds the child listview item representing the given UMLClassifierListItem.

## ◆ cancelRenameWithMsg()

void UMLListViewItem::cancelRenameWithMsg | ( |  | ) |
| protected

Auxiliary method for okRename().

## ◆ childItem()

UMLListViewItem * UMLListViewItem::childItem | ( | int | i | ) |

## ◆ deepCopy()

UMLListViewItem * UMLListViewItem::deepCopy | ( | UMLListViewItem * | newParent | ) |

Overrides the default sorting to sort by item type. Sort the listview items by type and position within the corresponding list of UMLObjects. If the item does not have an UMLObject then place it last.

Create a deep copy of this UMLListViewItem, but using the given parent instead of the parent of this UMLListViewItem. Return the new UMLListViewItem created.

## ◆ deleteChildItem()

void UMLListViewItem::deleteChildItem | ( | UMLClassifierListItem * | child | ) |

Deletes the child listview item representing the given UMLClassifierListItem.

## ◆ findChildObject()

UMLListViewItem * UMLListViewItem::findChildObject | ( | UMLClassifierListItem * | cli | ) |

Find the UMLListViewItem that represents the given UMLClassifierListItem in the children of the current UMLListViewItem. (Only makes sense if the current UMLListViewItem represents a UMLClassifier.) Return a pointer to the item or NULL if not found.

## ◆ findItem()

UMLListViewItem * UMLListViewItem::findItem | ( | Uml::ID::Type | id | ) |

Find the UMLListViewItem of the given ID in the tree rooted at the current UMLListViewItem. Return a pointer to the item or NULL if not found.

Parameters

  id | The ID to search for.

Returns
  The item with the given ID or NULL if not found.

## ◆ findUMLObject()

UMLListViewItem * UMLListViewItem::findUMLObject | ( | const UMLObject * | o | ) |

Find the UMLListViewItem that is related to the given UMLObject in the tree rooted at the current UMLListViewItem. Return a pointer to the item or NULL if not found.

## ◆ getSavedText()

QString UMLListViewItem::getSavedText | ( |  | ) | const

Returns the saved text.

## ◆ ID()

Uml::ID::Type UMLListViewItem::ID | ( |  | ) | const

Returns the id this class represents.

Returns
  The id this class represents.

## ◆ init()

void UMLListViewItem::init | ( |  | ) |
| protected

Initializes key variables of the class.

## ◆ isOpen()

bool UMLListViewItem::isOpen | ( |  | ) |
| inline

## ◆ isOwnParent()

bool UMLListViewItem::isOwnParent | ( | Uml::ID::Type | listViewItemID | ) |

Returns true if the UMLListViewItem of the given ID is a parent of this UMLListViewItem.

## ◆ loadFromXMI1()

bool UMLListViewItem::loadFromXMI1 | ( | QDomElement & | qElement | ) |

Loads a "listitem" tag, this is only used by the clipboard currently.

## ◆ saveToXMI1()

void UMLListViewItem::saveToXMI1 | ( | QDomDocument & | qDoc,
|  | QDomElement & | qElement
| ) |  |

Saves the listview item to a "listitem" tag.

## ◆ setIcon()

void UMLListViewItem::setIcon | ( | Icon_Utils::IconType | iconType | ) |

Set the pixmap corresponding to the given IconType.

## ◆ setID()

void UMLListViewItem::setID | ( | Uml::ID::Type | id | ) |

Sets the id this class represents. This only sets the ID locally, not at the UMLObject that is perhaps associated to this UMLListViewItem.

Parameters

  id | the id this class represents

## ◆ setOpen()

void UMLListViewItem::setOpen | ( | bool | expand | ) |

Overrides default method. Will call default method but also makes sure correct icon is shown.

## ◆ setText() [1/2]

void UMLListViewItem::setText | ( | const QString & | newText | ) |

Changes the current text of column 0.

## ◆ setText() [2/2]

void UMLListViewItem::setText | ( | int | column,
|  | const QString & | newText
| ) |  |

Changes the current text.

## ◆ setUMLObject()

void UMLListViewItem::setUMLObject | ( | UMLObject * | obj | ) |

Set the UMLObject associated with this instance.

Parameters

  obj | The object this class represents.

## ◆ setVisible()

void UMLListViewItem::setVisible | ( | bool | state | ) |

## ◆ slotEditFinished

void UMLListViewItem::slotEditFinished | ( | const QString & | newText | ) |
| slot

This slot is called to finish item editing

## ◆ toolTip()

QString UMLListViewItem::toolTip | ( |  | ) |

Returns the signature of items that are operations.

Returns
  signature of an operation item, else an empty string

## ◆ toString()

QString UMLListViewItem::toString | ( | ListViewType | type | ) |
| static

## ◆ type()

UMLListViewItem::ListViewType UMLListViewItem::type | ( |  | ) | const

Returns the type this instance represents.

Returns
  The type this instance represents.

## ◆ umlObject()

UMLObject * UMLListViewItem::umlObject | ( |  | ) | const

Return the UMLObject associated with this instance.

Returns
  The object this class represents.

## ◆ updateFolder()

void UMLListViewItem::updateFolder | ( |  | ) |

Updates the icon on a folder.

## ◆ updateObject()

void UMLListViewItem::updateObject | ( |  | ) |

Updates the representation of the object.

## Member Data Documentation

## ◆ m_comap

ChildObjectMap UMLListViewItem::m_comap
| protected

## ◆ m_id

Uml::ID::Type UMLListViewItem::m_id
| protected

## ◆ m_label

QString UMLListViewItem::m_label
| protected

## ◆ m_object

QPointer<UMLObject> UMLListViewItem::m_object
| protected

## ◆ m_type

ListViewType UMLListViewItem::m_type
| protected

The documentation for this class was generated from the following files:

- umbrello/umllistviewitem.h
- umbrello/umllistviewitem.cpp