diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/forkjoinwidget.h | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/forkjoinwidget.h')
-rw-r--r-- | umbrello/umbrello/forkjoinwidget.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/umbrello/umbrello/forkjoinwidget.h b/umbrello/umbrello/forkjoinwidget.h new file mode 100644 index 00000000..bf8c47c8 --- /dev/null +++ b/umbrello/umbrello/forkjoinwidget.h @@ -0,0 +1,103 @@ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * copyright (C) 2005-2006 * + * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * + ***************************************************************************/ + +#ifndef FORKJOINWIDGET_H +#define FORKJOINWIDGET_H +//qt includes +#include <qpainter.h> +//app includes +#include "boxwidget.h" + +// fwd decl. +class UMLView; + +/** + * @short Displays a fork/join plate in a state diagram. + * @author Oliver Kellogg <okellogg@users.sourceforge.net> + * @see UMLWidget + * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org + */ +class ForkJoinWidget : public BoxWidget { +public: + + /** + * Constructs a ForkJoinWidget. + * + * @param view The parent to this widget. + * @param drawVertical Whether to draw the plate horizontally or vertically. + * @param id The ID to assign (-1 will prompt a new ID.) + */ + explicit ForkJoinWidget(UMLView * view, bool drawVertical = false, Uml::IDType id = Uml::id_None); + + /** + * destructor + */ + virtual ~ForkJoinWidget(); + + /** + * Set whether to draw the plate vertically. + */ + void setDrawVertical(bool to); + /** + * Get whether to draw the plate vertically. + */ + bool getDrawVertical() const; + + /** + * Overrides the function from UMLWidget. + * + * @param sel The command to be executed. + */ + void slotMenuSelection(int sel); + + /** + * Draws a slim solid black rectangle. + */ + void draw(QPainter & p, int offsetX, int offsetY); + + /** + * Saves the widget to the "forkjoinwidget" XMI element. + */ + void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + + /** + * Loads the widget from the "forkjoinwidget" XMI element. + */ + bool loadFromXMI(QDomElement & qElement); + +protected: + /** + * Reimplement method from UMLWidget to suppress the resize corner. + * Although the ForkJoinWidget supports resizing, we suppress the + * resize corner because it is too large for this very slim widget. + */ + void drawSelected(QPainter * p, int offsetX, int offsetY); + + /** + * Overrides the function from UMLWidget. + */ + QSize calculateSize(); + + /** + * Reimplement method from UMLWidget. + */ + void constrain(int& width, int& height); + +private: + /** + * Initializes key variables for the class. + */ + void init(); + + bool m_drawVertical; ///< whether to draw the plate horizontally or vertically +}; + +#endif |