umbrello 26.03.70-1a62d36 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
UMLClipboard Class Reference

Clipboard management class. More...

`#include <umlclipboard.h>`

Inheritance diagram for UMLClipboard:

## Public Types

enum | UMLCopyType { clip1 = 1 , clip2 = 2 , clip3 = 3 , clip4 = 4 , clip5 = 5 }
| Enumeration that codes the different types of UML clips. More...

## Public Member Functions

| UMLClipboard ()
virtual | ~UMLClipboard ()
bool | paste (const QMimeData *data)
QMimeData * | copy (bool fromView=false)

## Private Member Functions

bool | pasteClip1 (const QMimeData *data)
bool | pasteClip2 (const QMimeData *data)
bool | pasteClip3 (const QMimeData *data)
bool | pasteClip4 (const QMimeData *data)
bool | pasteClip5 (const QMimeData *data)
void | addRelatedWidgets ()
void | fillObjectListForWidgets (const UMLWidgetList &widgets)
bool | fillSelectionLists (UMLListViewItemList &selectedItems)
void | setCopyType (UMLListViewItemList &selectedItems)
void | checkItemForCopyType (UMLListViewItem *item, bool &withDiagrams, bool &withObjects, bool &onlyAttsOps)
bool | insertItemChildren (UMLListViewItem *item, UMLListViewItemList &selectedItems)
void | pasteItemAlreadyExists ()

## Private Attributes

UMLObjectList | m_ObjectList
UMLListViewItemList | m_ItemList
UMLWidgetList | m_WidgetList
AssociationWidgetList | m_AssociationList
UMLViewList | m_ViewList
UMLCopyType | m_type
| Type of copy operation to perform. More...

## Detailed Description

Clipboard management class.

This class manages the uml's interaction with the KDE Clipboard. It makes possible to copy stuff from one uml instance to another one.

Author
  Gustavo Madrigal Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

## Member Enumeration Documentation

## ◆ UMLCopyType

enum UMLClipboard::UMLCopyType

Enumeration that codes the different types of UML clips.

Enumerator
clip1 | UMLObjects (not diagrams)
clip2 | UMLObjects, UMLListViewItems (not diagrams) and diagrams.
clip3 | UMLListViewItems (not diagrams)
clip4 | UMLObjects, Associations and UMLWidgets.
clip5 | Only Attributes, Operations, Templates and EnumLiterals.

## Constructor & Destructor Documentation

## ◆ UMLClipboard()

UMLClipboard::UMLClipboard | ( |  | ) |

Constructor.

## ◆ ~UMLClipboard()

UMLClipboard::~UMLClipboard | ( |  | ) |

virtual

Deconstructor.

## Member Function Documentation

## ◆ addRelatedWidgets()

void UMLClipboard::addRelatedWidgets | ( |  | ) |

private

Fills object list based on a selection of widgets

Parameters

  UMLWidgetList& | widgets

## ◆ checkItemForCopyType()

void UMLClipboard::checkItemForCopyType | ( | UMLListViewItem * | item,
|  | bool & | withDiagrams,
|  | bool & | withObjects,
|  | bool & | onlyAttsOps
| ) |  |

private

Searches the child items of a UMLListViewItem to establish which Copy type is to be performed.

Parameters

  item | parent of the children
  withDiagrams | includes diagrams
  withObjects | includes objects
  onlyAttsOps | includes only attributes and/or operations

## ◆ copy()

QMimeData * UMLClipboard::copy | ( | bool | fromView = `false` | ) |

Copy operation.

Parameters

  fromView | flag if it is from view

Returns
  the mime data

## ◆ fillObjectListForWidgets()

void UMLClipboard::fillObjectListForWidgets | ( | const UMLWidgetList & | widgets | ) |

private

Fills object list based on a selection of widgets

Parameters

  widgets | the UMLWidgetList to fill

## ◆ fillSelectionLists()

bool UMLClipboard::fillSelectionLists | ( | UMLListViewItemList & | selectedItems | ) |

private

Fills the member lists with all the objects and other stuff to be copied to the clipboard.

Parameters

  selectedItems | list of selected items

## ◆ insertItemChildren()

bool UMLClipboard::insertItemChildren | ( | UMLListViewItem * | item,
|  | UMLListViewItemList & | selectedItems
| ) |  |

private

Traverse children of a UMLListViewItem and add its UMLObjects to the list

Parameters

  item | parent of the children to insert
  selectedItems | list of selected items

Returns
  success flag

## ◆ paste()

bool UMLClipboard::paste | ( | const QMimeData * | data | ) |

Inserts the clipboard's contents.

Parameters

  data | Pointer to the MIME format clipboard data.

Returns
  True for successful operation.

## ◆ pasteClip1()

bool UMLClipboard::pasteClip1 | ( | const QMimeData * | data | ) |

private

If clipboard has mime type application/x-uml-clip1, Pastes the data from the clipboard into the current Doc.

Parameters

  data | mime type

## ◆ pasteClip2()

bool UMLClipboard::pasteClip2 | ( | const QMimeData * | data | ) |

private

If clipboard has mime type application/x-uml-clip2, Pastes the data from the clipboard into the current Doc.

Parameters

  data | mime type

Returns
  success flag

## ◆ pasteClip3()

bool UMLClipboard::pasteClip3 | ( | const QMimeData * | data | ) |

private

If clipboard has mime type application/x-uml-clip3, Pastes the data from the clipboard into the current Doc.

Note: clip3 is only used to determine if the selected items can be dragged onto the view. Pasting only listview items makes no sense. Clip3 is implemented as a fallback-clip when clip 1, 2, 4 or 5 are not applicable. But that should never happen.

Todo: remove clip3 altogether.

Parameters

  data | mime type

Returns
  success flag

## ◆ pasteClip4()

bool UMLClipboard::pasteClip4 | ( | const QMimeData * | data | ) |

private

If clipboard has mime type application/x-uml-clip4, Pastes the data from the clipboard into the current Doc.

Parameters

  data | mime type

Returns
  success flag

## ◆ pasteClip5()

bool UMLClipboard::pasteClip5 | ( | const QMimeData * | data | ) |

private

If clipboard has mime type application/x-uml-clip5, Pastes the data from the clipboard into the current Doc.

Parameters

  data | mime type

Returns
  success flag

## ◆ pasteItemAlreadyExists()

void UMLClipboard::pasteItemAlreadyExists | ( |  | ) |

private

Gives a `sorry' message box if you're pasting an item which already exists and can't be duplicated.

## ◆ setCopyType()

void UMLClipboard::setCopyType | ( | UMLListViewItemList & | selectedItems | ) |

private

Checks the whole list to determine the copy action type to be performed, sets the type in the m_type member variable.

Parameters

  selectedItems | list of selected items

## Member Data Documentation

## ◆ m_AssociationList

AssociationWidgetList UMLClipboard::m_AssociationList

private

## ◆ m_ItemList

UMLListViewItemList UMLClipboard::m_ItemList

private

## ◆ m_ObjectList

UMLObjectList UMLClipboard::m_ObjectList

private

## ◆ m_type

UMLCopyType UMLClipboard::m_type

private

Type of copy operation to perform.

## ◆ m_ViewList

UMLViewList UMLClipboard::m_ViewList

private

## ◆ m_WidgetList

UMLWidgetList UMLClipboard::m_WidgetList

private

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

- umbrello/clipboard/umlclipboard.h
- umbrello/clipboard/umlclipboard.cpp