aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/modeleditor/modeleditor.h
diff options
context:
space:
mode:
authorJochen Becher <jochen_becher@gmx.de>2015-09-21 12:11:02 +0200
committerJochen Becher <jochen_becher@gmx.de>2015-09-30 17:54:08 +0000
commit64760f0a8d1f72589d995accd003bfd9ec1cc792 (patch)
treec7c78d14d104a4d3432162f2092d711e93f7e1b9 /src/plugins/modeleditor/modeleditor.h
parent1c7fb225db61864c4122d6e396315f13ce2d8f97 (diff)
ModelEditor: Remove diagram's specific document and editor
Only one document is created per .qmodel file and only one editor is opened (splitting is not yet supported). The editor shows one diagram, another diagram can be shown from the model tree. Change-Id: Icd8211c14cb09203c52769a8ea1c90edb741ae51 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/modeleditor/modeleditor.h')
-rw-r--r--src/plugins/modeleditor/modeleditor.h91
1 files changed, 87 insertions, 4 deletions
diff --git a/src/plugins/modeleditor/modeleditor.h b/src/plugins/modeleditor/modeleditor.h
index 9cfcf05236..86859522c5 100644
--- a/src/plugins/modeleditor/modeleditor.h
+++ b/src/plugins/modeleditor/modeleditor.h
@@ -31,13 +31,39 @@
#ifndef MODELDIAGRAMEDITOR_H
#define MODELDIAGRAMEDITOR_H
-#include "abstracteditor.h"
+#include <coreplugin/editormanager/ieditor.h>
+
+#include <QAbstractButton>
+
+#include <functional>
+
+QT_BEGIN_NAMESPACE
+class QItemSelection;
+QT_END_NAMESPACE
+
+namespace qmt {
+class MElement;
+class MPackage;
+class MDiagram;
+class DElement;
+class DocumentController;
+}
namespace ModelEditor {
namespace Internal {
+class UiController;
+class ActionHandler;
+class DiagramsViewManager;
+
+enum class SelectedArea {
+ Nothing,
+ Diagram,
+ TreeView
+};
+
class ModelEditor :
- public AbstractEditor
+ public Core::IEditor
{
Q_OBJECT
class ModelEditorPrivate;
@@ -48,9 +74,66 @@ public:
~ModelEditor();
Core::IDocument *document() override;
+ QWidget *toolBar() override;
+
+ qmt::MDiagram *currentDiagram() const;
+ void showDiagram(qmt::MDiagram *diagram);
+ void undo();
+ void redo();
+ void cut();
+ void copy();
+ void paste();
+ void removeSelectedElements();
+ void deleteSelectedElements();
+ void selectAll();
+ void editProperties();
+ qmt::MPackage *guessSelectedPackage() const;
+
+private:
+ void init(QWidget *parent);
+ void initDocument();
+
+ void updateSelectedArea(SelectedArea selectedArea);
+ void showProperties(const QList<qmt::MElement *> &modelElements);
+ void showProperties(qmt::MDiagram *diagram, const QList<qmt::DElement *> &diagramElements);
+ void clearProperties();
+ void expandModelTreeToDepth(int depth);
+ QWidget *createToolbarCommandButton(const Core::Id &id, const std::function<void()> &slot,
+ const QIcon &icon,
+ const QString &toolTipBase, QWidget *parent);
+ bool updateButtonIconByTheme(QAbstractButton *button, const QString &name);
+
+ void onAddPackage();
+ void onAddComponent();
+ void onAddClass();
+ void onAddCanvasDiagram();
+ void onCurrentEditorChanged(Core::IEditor *editor);
+ void onCanUndoChanged(bool canUndo);
+ void onCanRedoChanged(bool canRedo);
+ void onTreeModelReset();
+ void onTreeViewSelectionChanged(const QItemSelection &selected,
+ const QItemSelection &deselected);
+ void onTreeViewActivated();
+ void onTreeViewDoubleClicked(const QModelIndex &index);
+ void onCurrentDiagramChanged(const qmt::MDiagram *diagram);
+ void onDiagramActivated(const qmt::MDiagram *diagram);
+ void onDiagramClipboardChanged(bool isEmpty);
+ void onNewElementCreated(qmt::DElement *element, qmt::MDiagram *diagram);
+ void onDiagramSelectionChanged(const qmt::MDiagram *diagram);
+ void onDiagramModified(const qmt::MDiagram *diagram);
+ Q_SLOT void onEditSelectedElement();
+
+ void onRightSplitterMoved(int pos, int index);
+ void onRightSplitterChanged(const QByteArray &state);
+ void onRightHorizSplitterMoved(int pos, int index);
+ void onRightHorizSplitterChanged(const QByteArray &state);
+
+ void initToolbars();
+ void closeCurrentDiagram();
+ void closeDiagram(const qmt::MDiagram *diagram);
+ void closeAllDiagrams();
-private slots:
- void onContentSet();
+ Q_SLOT void onContentSet();
private:
ModelEditorPrivate *d;