umbrello API Documentation

statewidget.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 STATEWIDGET_H
00013 #define STATEWIDGET_H
00014 #include <qpainter.h>
00015 #include <qstringlist.h>
00016 #include "umlwidget.h"
00017 #include "worktoolbar.h"
00018 
00019 #define STATE_MARGIN 5
00020 #define STATE_WIDTH 30
00021 #define STATE_HEIGHT 10
00022 
00038 class StateWidget : public UMLWidget {
00039     Q_OBJECT
00040 public:
00041 
00043     enum StateType
00044     {
00045         Initial = 0,
00046         Normal,
00047         End
00048     };
00049 
00057     explicit StateWidget( UMLView * view, StateType stateType = Normal, Uml::IDType id = Uml::id_None );
00058 
00062     virtual ~StateWidget();
00063 
00067     void draw(QPainter & p, int offsetX, int offsetY);
00068 
00072     virtual void setName(const QString &strName);
00073 
00077     virtual QString getName() const;
00078 
00082     StateType getStateType() const;
00083 
00087     void setStateType( StateType stateType );
00088 
00092     bool addActivity( const QString &activity );
00093 
00097     bool removeActivity( const QString &activity );
00098 
00102     bool renameActivity( const QString &activity, const QString &newName );
00103 
00107     void setActivities( QStringList & list );
00108 
00112     QStringList & getActivityList();
00113 
00117     void showProperties();
00118 
00126     static bool isState( WorkToolBar::ToolBar_Buttons tbb,
00127                          StateType& resultType );
00128 
00132     void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
00133 
00137     bool loadFromXMI( QDomElement & qElement );
00138 
00139 protected:
00143     QSize calculateSize();
00144 
00148     StateType m_StateType;
00149 
00153     QStringList m_Activities;
00154 
00155 public slots:
00156 
00160     void slotMenuSelection(int sel);
00161 };
00162 
00163 #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