umbrello API Documentation

umldrag.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2002-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef UMLDRAG_H
00013 #define UMLDRAG_H
00014 
00015 #include <qdragobject.h>
00016 #include <qobject.h>
00017 #include <qptrlist.h>
00018 
00019 #include "../umllistviewitemlist.h"
00020 #include "../associationwidgetlist.h"
00021 #include "../umlobjectlist.h"
00022 #include "../umlviewlist.h"
00023 #include "../umlwidgetlist.h"
00024 #include "../umlnamespace.h"
00025 
00034 class UMLListView;
00035 class UMLDragPrivate;
00036 class UMLClassifier;
00037 
00038 class Q_EXPORT UMLDrag : public QDragObject  {
00039     Q_OBJECT
00040     UMLDragPrivate* data;
00041 public:
00042 
00048     explicit UMLDrag(UMLObjectList& Objects,QWidget* dragSource = 0, const char* name = 0 );
00049 
00055     UMLDrag(UMLObjectList &Objects, UMLListViewItemList& UMLListViewItems,
00056             UMLViewList& Diagrams, QWidget * dragSource = 0, const char * name = 0 );
00057 
00063     explicit UMLDrag(UMLListViewItemList& UMLListViewItems, QWidget* dragSource = 0,
00064             const char* name = 0 );
00065 
00066     /*
00067      * For use when the user selects UMLObjects from a
00068      * Diagram. The Selected widegets and the relationships *
00069      * between only selected widgets will be copied and also
00070      * its respective ListView Items, Mime type =
00071      * "application/x-uml-clip4
00072      */
00073     UMLDrag(UMLObjectList& Objects, UMLWidgetList& Widgets, AssociationWidgetList& Associations,
00074             QPixmap& PngImage, Uml::Diagram_Type dType, QWidget* dragSource = 0,
00075             const char* name = 0 );
00076 
00082     UMLDrag(UMLObjectList& Objects, int, QWidget* dragSource = 0, const char* name = 0);
00083 
00087     explicit UMLDrag(QWidget* dragSource = 0, const char* name = 0);
00088 
00092     ~UMLDrag();
00093 
00098     void setUMLDataClip1(UMLObjectList& Objects);
00099 
00104     void setUMLDataClip2(UMLObjectList& Objects, UMLListViewItemList& UMLListViewItems,
00105                          UMLViewList& Diagrams);
00106 
00111     void setUMLDataClip3(UMLListViewItemList& UMLListViewItems);
00112 
00119     void setUMLDataClip4(UMLObjectList& Objects,
00120                          UMLWidgetList& WidgetDatas,
00121                          AssociationWidgetList& Associations, QPixmap& PngImage,
00122                          Uml::Diagram_Type dType);
00123 
00128     void setUMLDataClip5(UMLObjectList& Objects);
00129 
00134     virtual void setSubType(const QCString& sub, int index);
00135 
00139     virtual void setEncodedData(const QByteArray&, int index);
00140 
00144     const char* format(int index) const;
00145 
00151     virtual QByteArray encodedData(const char* dataName) const;
00152 
00159     static bool decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects);
00160 
00166     static bool decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
00167                             UMLListViewItemList& umlListViewItems,
00168                             UMLViewList& diagrams);
00169 
00175     static bool decodeClip3(const QMimeSource* mimeSource,
00176                             UMLListViewItemList& umlListViewItems,
00177                             const UMLListView* parentListView=0);
00178 
00179     struct LvTypeAndID {
00180         Uml::ListView_Type type;
00181         Uml::IDType id;
00182     };
00183     typedef QPtrList<LvTypeAndID> LvTypeAndID_List;
00184     typedef QPtrListIterator<LvTypeAndID> LvTypeAndID_It;
00185 
00193     static bool getClip3TypeAndID(const QMimeSource* mimeSource,
00194                                   LvTypeAndID_List& typeAndIdList);
00195 
00203     static bool decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
00204                             UMLWidgetList& widgets,
00205                             AssociationWidgetList& associations,
00206                             Uml::Diagram_Type & dType);
00207 
00213     static bool decodeClip5(const QMimeSource* mimeSource, UMLObjectList& objects,
00214                             UMLClassifier *newParent);
00215 
00219     static int getCodingType(const QMimeSource* mimeSource);
00220 
00221 };
00222 
00223 #endif
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:00 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003