umbrello API Documentation

UMLListViewItem Class Reference

Items used by the class UMLListView. Items used by UMLListView. More...

#include <umllistviewitem.h>

List of all members.

Public Member Functions

 UMLListViewItem (UMLListView *parent, const QString &name, Uml::ListView_Type t, UMLObject *o=0)
 Sets up an instance.
 UMLListViewItem (UMLListView *parent)
 Sets up an instance for subsequent loadFromXMI().
 UMLListViewItem (UMLListViewItem *parent)
 Sets up an instance for subsequent loadFromXMI().
 UMLListViewItem (UMLListViewItem *parent, const QString &name, Uml::ListView_Type t, UMLObject *o=0)
 Sets up an instance.
 UMLListViewItem (UMLListViewItem *parent, const QString &name, Uml::ListView_Type t, Uml::IDType id)
 Sets up an instance.
 ~UMLListViewItem ()
 Standard deconstructor.
Uml::ListView_Type getType () const
 Returns the type this instance represents.
void setID (Uml::IDType id)
 Sets the id this class represents.
Uml::IDType getID () const
 Returns the id this class represents.
void setUMLObject (UMLObject *obj)
 Set the UMLObject associated with this instance.
UMLObjectgetUMLObject ()
 Return the UMLObject associated with this instance.
bool isOwnParent (Uml::IDType listViewItemID)
 Returns true if the UMLListViewItem of the given ID is a parent of this UMLListViewItem.
void updateObject ()
 Updates the representation of the object.
void updateFolder ()
 Updates the icon on a folder.
void setOpen (bool open)
 Overrides default method.
void setText (const QString &text)
 Changes the current text and updates the tooltip.
QString getText () const
 Returns the current text.
void setCreating (bool creating)
 Sets if the item is in the middle of being created.
void setIcon (Uml::Icon_Type iconType)
 Set the pixmap corresponding to the given Icon_Type.
void cancelRename (int col)
 Overrides default method to make public.
void addClassifierListItem (UMLClassifierListItem *child, UMLListViewItem *childItem)
 Adds the child listview item representing the given UMLClassifierListItem.
void deleteChildItem (UMLClassifierListItem *child)
 Deletes the child listview item representing the given UMLClassifierListItem.
virtual int compare (QListViewItem *other, int col, bool ascending) const
 Overrides the default sorting to sort by item type.
int childCount () const
 Returns the number of children of the UMLListViewItem containing this object.
UMLListViewItemdeepCopy (UMLListViewItem *newParent)
 Create a deep copy of this UMLListViewItem, but using the given parent instead of the parent of this UMLListViewItem.
UMLListViewItemfindUMLObject (const UMLObject *o)
 Find the UMLListViewItem that is related to the given UMLObject in the tree rooted at the current UMLListViewItem.
UMLListViewItemfindChildObject (UMLClassifierListItem *cli)
 Find the UMLListViewItem that represents the given UMLClassifierListItem in the children of the current UMLListViewItem.
UMLListViewItemfindItem (Uml::IDType id)
 Find the UMLListViewItem of the given ID in the tree rooted at the current UMLListViewItem.
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 saves the listview item to a <listitem> tag
bool loadFromXMI (QDomElement &qElement)
 Loads a <listitem> tag, this is only used by the clipboard currently.

Protected Types

typedef QMap< UMLClassifierListItem *,
UMLListViewItem * > 
ChildObjectMap
 Auxiliary map of child UMLLisViewItems keyed by UMLClassifierListItem.

Protected Member Functions

void init (UMLListView *parent=0)
 Initializes key variables of the class.
void okRename (int col)
 This function is called if the user presses Enter during in-place renaming of the item in column col, reimplemented from QlistViewItem.
void cancelRenameWithMsg ()
 Auxiliary method for okRename().

Protected Attributes

bool m_bCreating
 Flag used to set the state of creating.
Uml::ListView_Type m_Type
Uml::IDType m_nId
int m_nChildren
UMLObjectm_pObject
QString m_Label
ChildObjectMap m_comap

Static Protected Attributes

static UMLListViews_pListView = 0
 This list view all the instance of this class are displayed on.


Detailed Description

Items used by the class UMLListView. Items used by UMLListView.

This is needed as the type and object information is required to be stored.

Author:
Paul Hensgen <phensgen@techie.com>
See also:
UMLListView Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 36 of file umllistviewitem.h.


Member Typedef Documentation

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.

Definition at line 275 of file umllistviewitem.h.


Constructor & Destructor Documentation

UMLListViewItem::UMLListViewItem UMLListView parent,
const QString &  name,
Uml::ListView_Type  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.

Definition at line 42 of file umllistviewitem.cpp.

References UMLObject::getID(), init(), setIcon(), and setText().

Referenced by deepCopy().

UMLListViewItem::UMLListViewItem UMLListView parent  ) 
 

Sets up an instance for subsequent loadFromXMI().

Parameters:
parent The parent to this instance.

Definition at line 55 of file umllistviewitem.cpp.

References init().

UMLListViewItem::UMLListViewItem UMLListViewItem parent  ) 
 

Sets up an instance for subsequent loadFromXMI().

Parameters:
parent The parent to this instance.

Definition at line 62 of file umllistviewitem.cpp.

References init().

UMLListViewItem::UMLListViewItem UMLListViewItem parent,
const QString &  name,
Uml::ListView_Type  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.

Definition at line 67 of file umllistviewitem.cpp.

References UMLObject::getID(), init(), setText(), updateFolder(), and updateObject().

UMLListViewItem::UMLListViewItem UMLListViewItem parent,
const QString &  name,
Uml::ListView_Type  t,
Uml::IDType  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.

Definition at line 86 of file umllistviewitem.cpp.

References init(), setIcon(), setText(), and updateFolder().

UMLListViewItem::~UMLListViewItem  ) 
 

Standard deconstructor.

Definition at line 128 of file umllistviewitem.cpp.


Member Function Documentation

Uml::ListView_Type UMLListViewItem::getType  )  const
 

Returns the type this instance represents.

Returns:
The type this instance represents.

Definition at line 143 of file umllistviewitem.cpp.

Referenced by UMLListView::addAtContainer(), compare(), UMLListView::createItem(), UMLListView::createUMLObject(), deepCopy(), UMLListView::determineParentItem(), UMLListView::findFolderForDiagram(), UMLListView::findUMLObjectInFolder(), UMLListView::findView(), UMLView::isSavedInSeparateFile(), UMLListView::isUnique(), UMLDoc::isUnique(), UMLObject::loadFromXMI(), UMLListView::slotCollapsed(), UMLListView::slotExpanded(), and UMLListView::slotObjectCreated().

void UMLListViewItem::setID Uml::IDType  id  ) 
 

Sets the id this class represents.

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

Returns:
The id this class represents.

Definition at line 168 of file umllistviewitem.cpp.

References UMLObject::getID().

Uml::IDType UMLListViewItem::getID  )  const
 

Returns the id this class represents.

Returns:
The id this class represents.

Definition at line 162 of file umllistviewitem.cpp.

References UMLObject::getID().

Referenced by UMLListView::createDiagramItem(), findItem(), UMLListView::findView(), okRename(), UMLListView::popupMenuSel(), and saveToXMI().

void UMLListViewItem::setUMLObject UMLObject obj  )  [inline]
 

Set the UMLObject associated with this instance.

Parameters:
obj The object this class represents.

Definition at line 115 of file umllistviewitem.h.

Referenced by UMLDoc::closeDocument(), UMLListView::createChildUMLObject(), and UMLListView::moveObject().

UMLObject* UMLListViewItem::getUMLObject  )  [inline]
 

Return the UMLObject associated with this instance.

Returns:
The object this class represents.

Definition at line 124 of file umllistviewitem.h.

Referenced by UMLListView::addAtContainer(), compare(), UMLListView::createChildUMLObject(), UMLListView::createDiagram(), UMLListView::createUMLObject(), UMLDrag::decodeClip2(), deepCopy(), UMLListView::deleteItem(), UMLListView::findUMLObjectInFolder(), UMLView::isSavedInSeparateFile(), UMLListView::isUnique(), UMLDoc::isUnique(), UMLObject::loadFromXMI(), UMLListView::moveObject(), and UMLListView::popupMenuSel().

bool UMLListViewItem::isOwnParent Uml::IDType  listViewItemID  ) 
 

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

Definition at line 178 of file umllistviewitem.cpp.

References UMLListView::findItem(), and s_pListView.

void UMLListViewItem::updateObject  ) 
 

Updates the representation of the object.

Definition at line 192 of file umllistviewitem.cpp.

References Model_Utils::convert_LVT_IT(), UMLObject::getBaseType(), UMLObject::getName(), UMLObject::getStereotype(), UMLObject::getVisibility(), setIcon(), setText(), and UMLClassifierListItem::toString().

Referenced by loadFromXMI(), UMLListView::slotObjectChanged(), and UMLListViewItem().

void UMLListViewItem::updateFolder  ) 
 

Updates the icon on a folder.

Definition at line 251 of file umllistviewitem.cpp.

References Model_Utils::convert_LVT_IT(), and setIcon().

Referenced by setOpen(), UMLListView::slotCollapsed(), UMLListView::slotExpanded(), and UMLListViewItem().

void UMLListViewItem::setOpen bool  open  ) 
 

Overrides default method.

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

Definition at line 260 of file umllistviewitem.cpp.

References updateFolder().

Referenced by UMLListView::addNewItem(), UMLListView::collapseAll(), UMLListView::expandAll(), UMLListView::init(), loadFromXMI(), and UMLListView::slotObjectCreated().

void UMLListViewItem::setText const QString &  text  ) 
 

Changes the current text and updates the tooltip.

Definition at line 265 of file umllistviewitem.cpp.

Referenced by UMLListView::childObjectAdded(), UMLListView::createChildUMLObject(), loadFromXMI(), UMLView::loadUISDiagram(), okRename(), UMLListView::popupMenuSel(), UMLListView::slotDiagramRenamed(), UMLListViewItem(), and updateObject().

QString UMLListViewItem::getText  )  const
 

Returns the current text.

Definition at line 270 of file umllistviewitem.cpp.

Referenced by UMLListView::addAtContainer(), compare(), deepCopy(), UMLListView::popupMenuSel(), and UMLListView::slotDropped().

void UMLListViewItem::setCreating bool  creating  )  [inline]
 

Sets if the item is in the middle of being created.

Definition at line 163 of file umllistviewitem.h.

References m_bCreating.

Referenced by UMLListView::addNewItem().

void UMLListViewItem::setIcon Uml::Icon_Type  iconType  ) 
 

Set the pixmap corresponding to the given Icon_Type.

Definition at line 274 of file umllistviewitem.cpp.

References UMLListView::getPixmap(), and s_pListView.

Referenced by UMLListView::addNewItem(), UMLListView::changeIconOf(), UMLListView::slotObjectCreated(), UMLListViewItem(), updateFolder(), and updateObject().

void UMLListViewItem::cancelRename int  col  ) 
 

Overrides default method to make public.

Definition at line 482 of file umllistviewitem.cpp.

References UMLListView::cancelRename(), m_bCreating, and s_pListView.

Referenced by UMLListView::popupMenuSel().

void UMLListViewItem::addClassifierListItem UMLClassifierListItem child,
UMLListViewItem childItem
 

Adds the child listview item representing the given UMLClassifierListItem.

Definition at line 147 of file umllistviewitem.cpp.

Referenced by UMLListView::createChildUMLObject(), and UMLListView::moveObject().

void UMLListViewItem::deleteChildItem UMLClassifierListItem child  ) 
 

Deletes the child listview item representing the given UMLClassifierListItem.

Definition at line 151 of file umllistviewitem.cpp.

References findChildObject().

Referenced by UMLListView::childObjectRemoved().

int UMLListViewItem::compare QListViewItem *  other,
int  col,
bool  ascending
const [virtual]
 

Overrides the default sorting to sort by item type.

Definition at line 491 of file umllistviewitem.cpp.

References UMLObject::getBaseType(), UMLClassifier::getFilteredList(), getText(), getType(), getUMLObject(), and Model_Utils::typeIsClassifierList().

int UMLListViewItem::childCount  )  const [inline]
 

Returns the number of children of the UMLListViewItem containing this object.

Definition at line 196 of file umllistviewitem.h.

UMLListViewItem * UMLListViewItem::deepCopy UMLListViewItem newParent  ) 
 

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

Return the new UMLListViewItem created.

Definition at line 578 of file umllistviewitem.cpp.

References getText(), getType(), getUMLObject(), and UMLListViewItem().

Referenced by UMLListView::moveObject().

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.

Definition at line 595 of file umllistviewitem.cpp.

Referenced by UMLListView::findUMLObject().

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.

Definition at line 608 of file umllistviewitem.cpp.

Referenced by UMLListView::childObjectAdded(), and deleteChildItem().

UMLListViewItem * UMLListViewItem::findItem Uml::IDType  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.

Definition at line 616 of file umllistviewitem.cpp.

References getID().

Referenced by UMLListView::findItem().

void UMLListViewItem::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
 

saves the listview item to a <listitem> tag

Definition at line 629 of file umllistviewitem.cpp.

References UMLObject::getBaseType(), UMLListView::getDocument(), UMLFolder::getFolderFile(), UMLObject::getID(), getID(), and s_pListView.

Referenced by UMLDrag::setUMLDataClip2(), and UMLDrag::setUMLDataClip3().

bool UMLListViewItem::loadFromXMI QDomElement &  qElement  ) 
 

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

Definition at line 672 of file umllistviewitem.cpp.

References UMLDoc::findObjectById(), UMLListView::getDocument(), s_pListView, setOpen(), setText(), and updateObject().

Referenced by UMLDrag::decodeClip2(), and UMLDrag::decodeClip3().

void UMLListViewItem::init UMLListView parent = 0  )  [protected]
 

Initializes key variables of the class.

Definition at line 130 of file umllistviewitem.cpp.

References m_bCreating, and s_pListView.

Referenced by UMLListViewItem().

void UMLListViewItem::okRename int  col  )  [protected]
 

This function is called if the user presses Enter during in-place renaming of the item in column col, reimplemented from QlistViewItem.

Definition at line 278 of file umllistviewitem.cpp.

References UMLOperation::addParm(), cancelRenameWithMsg(), UMLCanvasObject::findChildObject(), UMLListView::getDocument(), getID(), UMLOperation::getParmList(), UMLView::getType(), UMLDoc::isUnique(), UMLListView::itemRenamed(), Model_Utils::OpDescriptor::m_args, m_bCreating, Model_Utils::NameAndType::m_direction, Model_Utils::NameAndType::m_initialValue, Model_Utils::NameAndType::m_name, Model_Utils::OpDescriptor::m_name, Model_Utils::OpDescriptor::m_pReturnType, Model_Utils::NameAndType::m_type, Model_Utils::parseAttribute(), Model_Utils::parseOperation(), Model_Utils::parseTemplate(), Model_Utils::psText(), UMLOperation::removeParm(), s_pListView, UMLObject::setID(), UMLAttribute::setInitialValue(), UMLDoc::setModified(), UMLView::setName(), UMLObject::setName(), UMLAttribute::setParmKind(), setText(), UMLClassifierListItem::setType(), UMLOperation::setType(), UMLObject::setVisibility(), UMLDoc::signalDiagramRenamed(), UMLTemplate::toString(), UMLAttribute::toString(), and UMLOperation::toString().

void UMLListViewItem::cancelRenameWithMsg  )  [protected]
 

Auxiliary method for okRename().

Definition at line 475 of file umllistviewitem.cpp.

Referenced by okRename().


Member Data Documentation

UMLListView * UMLListViewItem::s_pListView = 0 [static, protected]
 

This list view all the instance of this class are displayed on.

Definition at line 40 of file umllistviewitem.cpp.

Referenced by cancelRename(), init(), isOwnParent(), loadFromXMI(), okRename(), saveToXMI(), and setIcon().

bool UMLListViewItem::m_bCreating [protected]
 

Flag used to set the state of creating.

Definition at line 267 of file umllistviewitem.h.

Referenced by cancelRename(), init(), okRename(), and setCreating().


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