Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SCFORMVIEW_H
00023 #define SCFORMVIEW_H
00024
00025
00026 #include <QMainWindow>
00027 #include "scdatamodel.h"
00028 #include <QList>
00029 #include <QModelIndex>
00030
00031 class StateSelectionWindow;
00032
00033
00034 QT_BEGIN_NAMESPACE
00035 class QAction;
00036 class QToolBox;
00037 class QSpinBox;
00038 class QComboBox;
00039 class QFontComboBox;
00040 class QButtonGroup;
00041 class QLineEdit;
00042 class QGraphicsTextItem;
00043 class QFont;
00044 class QToolButton;
00045 class QAbstractButton;
00046 class QGraphicsView;
00047 class QTreeWidget;
00048 class QTreeWidgetItem;
00049 class CustomTreeWidgetItem;
00050 class QTableWidget;
00051 class QLabel;
00052 class TextBlock;
00053 QT_END_NAMESPACE
00054
00055
00070 class SCFormView : public QMainWindow
00071 {
00072 Q_OBJECT
00073 public:
00074 explicit SCFormView(QWidget *parent = 0, SCDataModel * dm=0);
00075
00076
00077 private slots:
00078 void backgroundButtonGroupClicked(QAbstractButton *button);
00079 void buttonGroupClicked(int id);
00080 void deleteItem();
00081 void pointerGroupClicked(int id);
00082 void bringToFront();
00083 void sendToBack();
00084 void insertTransition();
00085 void insertState();
00086 void textInserted(QGraphicsTextItem *item);
00087 void currentFontChanged(const QFont &font);
00088 void fontSizeChanged(const QString &size);
00089 void sceneScaleChanged(const QString &scale);
00090 void textColorChanged();
00091 void itemColorChanged();
00092 void lineColorChanged();
00093 void textButtonTriggered();
00094 void fillButtonTriggered();
00095 void lineButtonTriggered();
00096 void handleFontChange();
00097 void handleBoldChanged();
00098
00099 void about();
00100
00101 void handleTreeViewItemClicked(QTreeWidgetItem*,int);
00102 void handleNewTransition(SCTransition*);
00103 void handleNewState(SCState*);
00104
00105 void handlePropertyChanged(IAttribute * attr);
00106 void handlePropertyCellChanged(int, int);
00107 void handleStateSelectionWindowStateSelected(SCState *st, QString name);
00108
00109 private:
00110
00111 IAttributeContainer * getCurrentlySelectedAttributes();
00112 QString getCurrentlySelectedTitle();
00113 QString getCurrentlySelectedType();
00114
00115 void createToolBox();
00116 void createActions();
00117 void createMenus();
00118 void createToolbars();
00119 QWidget *createBackgroundCellWidget(const QString &text, const QString &image);
00120
00121 QMenu *createColorMenu(const char *slot, QColor defaultColor);
00122 QIcon createColorToolButtonIcon(const QString &image, QColor color);
00123 QIcon createColorIcon(QColor color);
00124 void loadTree ( CustomTreeWidgetItem * parentItem , QList<SCState*> & states);
00125 void loadTree ( CustomTreeWidgetItem * parentItem , QList<SCTransition*> & transitions);
00126 void loadTree ( CustomTreeWidgetItem * parentItem , TextBlock* textBlock);
00127
00128 QTreeWidget *stateChartTreeView;
00129 QTableWidget *propertyTable;
00130 QLabel *selectedChartItem;
00131
00132 QGraphicsView *view;
00133
00134 QAction *exitAction;
00135 QAction *addAction;
00136 QAction *deleteAction;
00137
00138 QAction *toFrontAction;
00139 QAction *sendBackAction;
00140 QAction *insertTransitionAction;
00141 QAction *insertStateAction;
00142 QAction *aboutAction;
00143
00144 QMenu *fileMenu;
00145 QMenu *itemMenu;
00146 QMenu *aboutMenu;
00147
00148 QToolBar *textToolBar;
00149 QToolBar *editToolBar;
00150 QToolBar *colorToolBar;
00151 QToolBar *pointerToolbar;
00152
00153 QComboBox *sceneScaleCombo;
00154 QComboBox *itemColorCombo;
00155 QComboBox *textColorCombo;
00156 QComboBox *fontSizeCombo;
00157 QFontComboBox *fontCombo;
00158
00159 QToolBox *toolBox;
00160 QButtonGroup *buttonGroup;
00161 QButtonGroup *pointerTypeGroup;
00162 QButtonGroup *backgroundButtonGroup;
00163 QToolButton *fontColorToolButton;
00164 QToolButton *fillColorToolButton;
00165 QToolButton *lineColorToolButton;
00166 QAction *boldAction;
00167 QAction *underlineAction;
00168 QAction *italicAction;
00169 QAction *textAction;
00170 QAction *fillAction;
00171 QAction *lineAction;
00172
00173 SCDataModel * _dm;
00174 QObject * _currentlySelected;
00175 StateSelectionWindow * _targetStateSelectionWindow;
00176
00177
00178 };
00179
00180
00181 #endif // SCFORMVIEW_H