umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
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:
Collaboration 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

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
Here is the call graph for this function:

◆ 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
itemparent of the children
withDiagramsincludes diagrams
withObjectsincludes objects
onlyAttsOpsincludes only attributes and/or operations
Here is the call graph for this function:

◆ copy()

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

Copy operation.

Parameters
fromViewflag if it is from view
Returns
the mime data
Here is the call graph for this function:

◆ fillObjectListForWidgets()

void UMLClipboard::fillObjectListForWidgets ( const UMLWidgetList widgets)
private

Fills object list based on a selection of widgets

Parameters
widgetsthe UMLWidgetList to fill
Here is the call graph for this function:

◆ 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
selectedItemslist of selected items
Here is the call graph for this function:

◆ insertItemChildren()

bool UMLClipboard::insertItemChildren ( UMLListViewItem item,
UMLListViewItemList selectedItems 
)
private

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

Parameters
itemparent of the children to insert
selectedItemslist of selected items
Returns
success flag
Here is the call graph for this function:

◆ paste()

bool UMLClipboard::paste ( const QMimeData *  data)

Inserts the clipboard's contents.

Parameters
dataPointer to the MIME format clipboard data.
Returns
True for successful operation.
Here is the call graph for this function:

◆ 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
datamime type
Here is the call graph for this function:

◆ 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
datamime type
Returns
success flag
Here is the call graph for this function:

◆ 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
datamime type
Returns
success flag
Here is the call graph for this function:

◆ 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
datamime type
Returns
success flag
Here is the call graph for this function:

◆ 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
datamime type
Returns
success flag
Here is the call graph for this function:

◆ pasteItemAlreadyExists()

void UMLClipboard::pasteItemAlreadyExists ( )
private

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

Here is the call graph for this function:

◆ 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
selectedItemslist of selected items
Here is the call graph for this function:

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: