umbrello API Documentation

toolbarstate.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) 2004-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef TOOLBARSTATE_H
00013 #define TOOLBARSTATE_H
00014 
00015 #include <qevent.h>
00016 #include <qobject.h>
00017 
00018 class QEvent;
00019 class QMouseEvent;
00020 
00021 class AssociationWidget;
00022 class MessageWidget;
00023 class UMLView;
00024 class UMLWidget;
00025 
00026 
00071 class ToolBarState: public QObject {
00072     Q_OBJECT
00073 public:
00074 
00079     virtual ~ToolBarState();
00080 
00085     virtual void init();
00086 
00092     virtual void cleanBeforeChange();
00093 
00105     virtual void mousePress(QMouseEvent *ome);
00106 
00116     virtual void mouseRelease(QMouseEvent* ome);
00117 
00126     virtual void mouseDoubleClick(QMouseEvent* ome);
00127 
00141     virtual void mouseMove(QMouseEvent* ome);
00142 
00143 public slots:
00144 
00151     virtual void slotAssociationRemoved(AssociationWidget* association);
00152 
00159     virtual void slotWidgetRemoved(UMLWidget* widget);
00160 
00161 protected:
00162 
00171     ToolBarState(UMLView *umlView);
00172 
00181     virtual void setCurrentElement();
00182 
00187     virtual void mousePressAssociation();
00188 
00193     virtual void mousePressWidget();
00194 
00199     virtual void mousePressEmpty();
00200 
00205     virtual void mouseReleaseAssociation();
00206 
00211     virtual void mouseReleaseWidget();
00212 
00217     virtual void mouseReleaseEmpty();
00218 
00223     virtual void mouseDoubleClickAssociation();
00224 
00229     virtual void mouseDoubleClickWidget();
00230 
00235     virtual void mouseDoubleClickEmpty();
00236 
00242     virtual void mouseMoveAssociation();
00243 
00249     virtual void mouseMoveWidget();
00250 
00256     virtual void mouseMoveEmpty();
00257 
00262     virtual void changeTool();
00263 
00269     virtual UMLWidget* getCurrentWidget() {
00270         return m_currentWidget;
00271     }
00272 
00282     virtual void setCurrentWidget(UMLWidget* currentWidget) {
00283         m_currentWidget = currentWidget;
00284     }
00285 
00291     virtual AssociationWidget* getCurrentAssociation() {
00292         return m_currentAssociation;
00293     }
00294 
00304     virtual void setCurrentAssociation(AssociationWidget* currentAssociation) {
00305         m_currentAssociation = currentAssociation;
00306     }
00307 
00316     void setMouseEvent(QMouseEvent* ome, const QEvent::Type &type);
00317 
00326     AssociationWidget* getAssociationAt(QPoint pos);
00327 
00337     MessageWidget* getMessageAt(QPoint pos);
00338 
00342     UMLView* m_pUMLView;
00343 
00349     QMouseEvent* m_pMouseEvent;
00350 
00351 private:
00352 
00356     UMLWidget* m_currentWidget;
00357 
00361     AssociationWidget* m_currentAssociation;
00362 
00363 };
00364 
00365 #endif //TOOLBARSTATE_H
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