umbrello API Documentation

activitywidget.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 ACTIVITYWIDGET_H
00013 #define ACTIVITYWIDGET_H
00014 
00015 #include "umlwidget.h"
00016 #include "worktoolbar.h"
00017 
00018 #define ACTIVITY_MARGIN 5
00019 #define ACTIVITY_WIDTH 30
00020 #define ACTIVITY_HEIGHT 10
00021 
00034 class ActivityWidget : public UMLWidget {
00035     Q_OBJECT
00036 
00037 public:
00038     enum ActivityType
00039     {
00040         Initial = 0,
00041         Normal,
00042         End,
00043         Branch
00044     };
00045 
00053     explicit ActivityWidget( UMLView * view, ActivityType activityType = Normal, Uml::IDType id = Uml::id_None );
00054 
00055 
00059     virtual ~ActivityWidget();
00060 
00064     void draw(QPainter & p, int offsetX, int offsetY);
00065 
00069     void constrain(int& width, int& height);
00070 
00074     ActivityType getActivityType() const;
00075 
00079     void setActivityType( ActivityType activityType );
00080 
00084     void showProperties();
00085 
00095     static bool isActivity( WorkToolBar::ToolBar_Buttons tbb,
00096                             ActivityType& resultType );
00097 
00101     void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
00102 
00106     bool loadFromXMI( QDomElement & qElement );
00107 
00108 protected:
00112     QSize calculateSize();
00113 
00117     ActivityType m_ActivityType;
00118 
00119 public slots:
00120 
00124     void slotMenuSelection(int sel);
00125 };
00126 
00127 #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:07:53 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003