umbrello API Documentation

UMLDrag Class Reference

This class provides encoding and decoding for the uml data that will be used in a drag and drop operation or in a copy or paste operation. More...

#include <umldrag.h>

List of all members.

Public Types

typedef QPtrList< LvTypeAndID > LvTypeAndID_List
typedef QPtrListIterator<
LvTypeAndID > 
LvTypeAndID_It

Public Member Functions

 UMLDrag (UMLObjectList &Objects, QWidget *dragSource=0, const char *name=0)
 For use when the user selects only UML Objects from the ListView but no diagrams to be copied, Mime type = "application/x-uml-clip1.
 UMLDrag (UMLObjectList &Objects, UMLListViewItemList &UMLListViewItems, UMLViewList &Diagrams, QWidget *dragSource=0, const char *name=0)
 For use when the user selects UML Object and Diagrams from the ListView to be copied, Mime type = "application/x-uml-clip2.
 UMLDrag (UMLListViewItemList &UMLListViewItems, QWidget *dragSource=0, const char *name=0)
 For use when the user selects only empty folders from the ListView to be copied, Mime type = "application/x-uml-clip3.
 UMLDrag (UMLObjectList &Objects, UMLWidgetList &Widgets, AssociationWidgetList &Associations, QPixmap &PngImage, Uml::Diagram_Type dType, QWidget *dragSource=0, const char *name=0)
 UMLDrag (UMLObjectList &Objects, int, QWidget *dragSource=0, const char *name=0)
 For use when the user selects only Operations and/or Attributes from the ListView, Mime type = "application/x-uml-clip5.
 UMLDrag (QWidget *dragSource=0, const char *name=0)
 Constructor.
 ~UMLDrag ()
 Deconstructor.
void setUMLDataClip1 (UMLObjectList &Objects)
 For use when the user selects only UMLObjects from the ListView but no diagrams to be copied.
void setUMLDataClip2 (UMLObjectList &Objects, UMLListViewItemList &UMLListViewItems, UMLViewList &Diagrams)
 For use when the user selects UML Object and Diagrams from the ListView to be copied.
void setUMLDataClip3 (UMLListViewItemList &UMLListViewItems)
 For use when the user selects only empty folders from the ListView to be copied.
void setUMLDataClip4 (UMLObjectList &Objects, UMLWidgetList &WidgetDatas, AssociationWidgetList &Associations, QPixmap &PngImage, Uml::Diagram_Type dType)
 For use when the user selects UML Objects from a Diagram.
void setUMLDataClip5 (UMLObjectList &Objects)
 For use when the user selects only Attirbutes and/or Operation from the ListView.
virtual void setSubType (const QCString &sub, int index)
 Sets the type of the clip to "application/x-uml-" + sub sub should be clip[1-5].
virtual void setEncodedData (const QByteArray &, int index)
 Sets the data in the clip.
const char * format (int index) const
 Returns the type set by setSubType.
virtual QByteArray encodedData (const char *dataName) const
 Returns the encoded data of the given type.

Static Public Member Functions

static bool decodeClip1 (const QMimeSource *mimeSource, UMLObjectList &objects)
 For use when the user selects only UML Objects from the ListView but no diagrams to be copied, decodes Mime type = "application/x-uml-clip1.
static bool decodeClip2 (const QMimeSource *mimeSource, UMLObjectList &objects, UMLListViewItemList &umlListViewItems, UMLViewList &diagrams)
 For use when the user selects UML Object and Diagrams from the ListView to be copied, decodes Mime type = "application/x-uml-clip2.
static bool decodeClip3 (const QMimeSource *mimeSource, UMLListViewItemList &umlListViewItems, const UMLListView *parentListView=0)
 For use when the user selects UMLObjects from the ListView to be copied, decodes Mime * type = "application/x-uml-clip3.
static bool getClip3TypeAndID (const QMimeSource *mimeSource, LvTypeAndID_List &typeAndIdList)
 Return just the LvTypeAndID of a Clip3.
static bool decodeClip4 (const QMimeSource *mimeSource, UMLObjectList &objects, UMLWidgetList &widgets, AssociationWidgetList &associations, Uml::Diagram_Type &dType)
 For use when the user selects UML Objects from a Diagram.
static bool decodeClip5 (const QMimeSource *mimeSource, UMLObjectList &objects, UMLClassifier *newParent)
 For use when the user selects only Attributes and/or Operations from the ListView * copied, decodes Mime type = "application/x-uml-clip5.
static int getCodingType (const QMimeSource *mimeSource)
 Converts application/x-uml-clip[1-5] clip type to an integer.


Detailed Description

This class provides encoding and decoding for the uml data that will be used in a drag and drop operation or in a copy or paste operation.

Author:
Gustavo Madrigal, Jonathan Riddell (XMI conversion) Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 38 of file umldrag.h.


Constructor & Destructor Documentation

UMLDrag::UMLDrag UMLObjectList Objects,
QWidget *  dragSource = 0,
const char *  name = 0
[explicit]
 

For use when the user selects only UML Objects from the ListView but no diagrams to be copied, Mime type = "application/x-uml-clip1.

Definition at line 67 of file umldrag.cpp.

References setUMLDataClip1().

UMLDrag::UMLDrag UMLObjectList Objects,
UMLListViewItemList &  UMLListViewItems,
UMLViewList &  Diagrams,
QWidget *  dragSource = 0,
const char *  name = 0
 

For use when the user selects UML Object and Diagrams from the ListView to be copied, Mime type = "application/x-uml-clip2.

Definition at line 73 of file umldrag.cpp.

References setUMLDataClip2().

UMLDrag::UMLDrag UMLListViewItemList &  UMLListViewItems,
QWidget *  dragSource = 0,
const char *  name = 0
[explicit]
 

For use when the user selects only empty folders from the ListView to be copied, Mime type = "application/x-uml-clip3.

Definition at line 79 of file umldrag.cpp.

References setUMLDataClip3().

UMLDrag::UMLDrag UMLObjectList Objects,
int  ,
QWidget *  dragSource = 0,
const char *  name = 0
 

For use when the user selects only Operations and/or Attributes from the ListView, Mime type = "application/x-uml-clip5.

Definition at line 93 of file umldrag.cpp.

References setUMLDataClip5().

UMLDrag::UMLDrag QWidget *  dragSource = 0,
const char *  name = 0
[explicit]
 

Constructor.

Definition at line 99 of file umldrag.cpp.

UMLDrag::~UMLDrag  ) 
 

Deconstructor.

Definition at line 103 of file umldrag.cpp.


Member Function Documentation

void UMLDrag::setUMLDataClip1 UMLObjectList Objects  ) 
 

For use when the user selects only UMLObjects from the ListView but no diagrams to be copied.

Definition at line 130 of file umldrag.cpp.

References UMLObject::saveToXMI(), setEncodedData(), and setSubType().

Referenced by UMLDrag().

void UMLDrag::setUMLDataClip2 UMLObjectList Objects,
UMLListViewItemList &  UMLListViewItems,
UMLViewList &  Diagrams
 

For use when the user selects UML Object and Diagrams from the ListView to be copied.

Definition at line 152 of file umldrag.cpp.

References UMLListViewItem::saveToXMI(), UMLView::saveToXMI(), UMLObject::saveToXMI(), setEncodedData(), and setSubType().

Referenced by UMLDrag().

void UMLDrag::setUMLDataClip3 UMLListViewItemList &  UMLListViewItems  ) 
 

For use when the user selects only empty folders from the ListView to be copied.

Definition at line 191 of file umldrag.cpp.

References UMLListViewItem::saveToXMI(), setEncodedData(), and setSubType().

Referenced by UMLDrag().

void UMLDrag::setUMLDataClip4 UMLObjectList Objects,
UMLWidgetList &  WidgetDatas,
AssociationWidgetList &  Associations,
QPixmap &  PngImage,
Uml::Diagram_Type  dType
 

For use when the user selects UML Objects from a Diagram.

The Selected widegets and the relationships between only selected widgets will be copied and also its respective ListView Items

Definition at line 210 of file umldrag.cpp.

References AssociationWidget::saveToXMI(), UMLWidget::saveToXMI(), UMLObject::saveToXMI(), setEncodedData(), and setSubType().

void UMLDrag::setUMLDataClip5 UMLObjectList Objects  ) 
 

For use when the user selects only Attirbutes and/or Operation from the ListView.

Definition at line 262 of file umldrag.cpp.

References UMLObject::saveToXMI(), setEncodedData(), and setSubType().

Referenced by UMLDrag().

void UMLDrag::setSubType const QCString &  sub,
int  index
[virtual]
 

Sets the type of the clip to "application/x-uml-" + sub sub should be clip[1-5].

Definition at line 107 of file umldrag.cpp.

Referenced by setUMLDataClip1(), setUMLDataClip2(), setUMLDataClip3(), setUMLDataClip4(), and setUMLDataClip5().

void UMLDrag::setEncodedData const QByteArray &  ,
int  index
[virtual]
 

Sets the data in the clip.

Definition at line 111 of file umldrag.cpp.

References encodedData().

Referenced by setUMLDataClip1(), setUMLDataClip2(), setUMLDataClip3(), setUMLDataClip4(), and setUMLDataClip5().

const char * UMLDrag::format int  index  )  const
 

Returns the type set by setSubType.

Definition at line 125 of file umldrag.cpp.

QByteArray UMLDrag::encodedData const char *  dataName  )  const [virtual]
 

Returns the encoded data of the given type.

Parameters:
dataName the name of the data type to return

Definition at line 115 of file umldrag.cpp.

Referenced by setEncodedData().

bool UMLDrag::decodeClip1 const QMimeSource *  mimeSource,
UMLObjectList objects
[static]
 

For use when the user selects only UML Objects from the ListView but no diagrams to be copied, decodes Mime type = "application/x-uml-clip1.

Definition at line 284 of file umldrag.cpp.

References UMLDoc::assignNewIDs(), UMLObject::getBaseType(), UMLApp::getDocument(), UMLApp::getListView(), UMLObject::getName(), UMLObject::getUMLPackage(), UMLObject::loadFromXMI(), UMLObject::resolveRef(), UMLObject::setInPaste(), UMLObject::setName(), UMLListView::startedCopy(), and Model_Utils::uniqObjectName().

bool UMLDrag::decodeClip2 const QMimeSource *  mimeSource,
UMLObjectList objects,
UMLListViewItemList &  umlListViewItems,
UMLViewList &  diagrams
[static]
 

For use when the user selects UML Object and Diagrams from the ListView to be copied, decodes Mime type = "application/x-uml-clip2.

Definition at line 373 of file umldrag.cpp.

References UMLListView::findFolderForDiagram(), UMLObject::getBaseType(), UMLApp::getListView(), UMLListViewItem::getUMLObject(), UMLListViewItem::loadFromXMI(), UMLView::loadFromXMI(), and UMLObject::loadFromXMI().

bool UMLDrag::decodeClip3 const QMimeSource *  mimeSource,
UMLListViewItemList &  umlListViewItems,
const UMLListView parentListView = 0
[static]
 

For use when the user selects UMLObjects from the ListView to be copied, decodes Mime * type = "application/x-uml-clip3.

Definition at line 541 of file umldrag.cpp.

References UMLListViewItem::loadFromXMI().

bool UMLDrag::getClip3TypeAndID const QMimeSource *  mimeSource,
LvTypeAndID_List &  typeAndIdList
[static]
 

Return just the LvTypeAndID of a Clip3.

Parameters:
mimeSource The encoded source.
typeAndIdList The LvTypeAndID_List decoded from the source.
Returns:
True if decoding was successful.

Definition at line 483 of file umldrag.cpp.

Referenced by UMLView::contentsDragEnterEvent(), and UMLView::contentsDropEvent().

bool UMLDrag::decodeClip4 const QMimeSource *  mimeSource,
UMLObjectList objects,
UMLWidgetList &  widgets,
AssociationWidgetList &  associations,
Uml::Diagram_Type &  dType
[static]
 

For use when the user selects UML Objects from a Diagram.

The Selected widegets and the relationships between only * selected widgets will be copied and also its respective ListView Items, * decodes Mime type = "application/x-uml-clip4

Definition at line 599 of file umldrag.cpp.

References UMLApp::getCurrentView(), UMLApp::getDocument(), AssociationWidget::loadFromXMI(), UMLObject::loadFromXMI(), and UMLView::loadWidgetFromXMI().

bool UMLDrag::decodeClip5 const QMimeSource *  mimeSource,
UMLObjectList objects,
UMLClassifier newParent
[static]
 

For use when the user selects only Attributes and/or Operations from the ListView * copied, decodes Mime type = "application/x-uml-clip5.

Definition at line 698 of file umldrag.cpp.

References UMLObject::loadFromXMI(), and UMLObject::resolveRef().

int UMLDrag::getCodingType const QMimeSource *  mimeSource  )  [static]
 

Converts application/x-uml-clip[1-5] clip type to an integer.

Definition at line 753 of file umldrag.cpp.

Referenced by UMLClipboard::paste().


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