00001 /* 00002 visualsc - Visual State Chart Editing for SCXML State Engines 00003 Copyright (C) 2011 David W. Drell (david@davidwdrell.net) and 00004 Contributing Authors: 00005 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 00022 #ifndef STATEBOX_H 00023 #define STATEBOX_H 00024 00025 00026 #include "selectableboxgraphic.h" 00027 #include "selectabletextblock.h" 00028 00029 class SCState; 00030 class IAttribute; 00031 00032 00033 00041 class StateBoxGraphic : public SelectableBoxGraphic 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 StateBoxGraphic(QGraphicsObject*parent, SCState * state); 00047 ~StateBoxGraphic(); 00048 00049 SelectableTextBlock TextItem; 00050 00051 void setGridSpace(int space); 00052 //void setTitle(QString t); 00053 void setSize(QPoint size); 00054 QString getPositionAsString(); 00055 QString getSizeAsString(); 00056 void getSize(QPoint& size); 00057 void setHighlighted(bool); 00058 00059 private: 00060 00061 00062 virtual void graphicHasChanged (); 00063 00064 00065 // private slots 00066 00067 private slots: 00068 00069 00070 void handleAttributeChanged(IAttribute *attr); 00071 00072 00073 00074 private: 00075 //private data 00076 00077 SCState * _stateModel; 00078 }; 00079 00080 #endif // STATEBOX_H