aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/shortcutmanager.h
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@digia.com>2013-01-23 12:31:22 +0100
committerMarco Bubke <marco.bubke@digia.com>2013-01-23 14:53:28 +0100
commit8d9710c0747a68f9938c8e7d32110f67ba64cc1e (patch)
treefda8332d2625520be7d282dcdbe20f48ad10f3ed /src/plugins/qmldesigner/shortcutmanager.h
parenta4455f37110f09e326b984977baae286082366ad (diff)
Refactoring document handling
The document handling in the qml designer was complicated source code, which was initially intended for a non creator application. To integrate new views it has to be changed and cleaned up. This is the first major step in that direction. Change-Id: Ie26f0aad7a03946d18bdb4c0759b246c5439d922 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com> Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/shortcutmanager.h')
-rw-r--r--src/plugins/qmldesigner/shortcutmanager.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/shortcutmanager.h b/src/plugins/qmldesigner/shortcutmanager.h
new file mode 100644
index 0000000000..03a5450eb6
--- /dev/null
+++ b/src/plugins/qmldesigner/shortcutmanager.h
@@ -0,0 +1,72 @@
+#ifndef QMLDESIGNER_SHORTCUTMANAGER_H
+#define QMLDESIGNER_SHORTCUTMANAGER_H
+
+#include <QObject>
+#include <QAction>
+#include <utils/parameteraction.h>
+
+
+namespace Core {
+ class IEditor;
+}
+
+namespace QmlDesigner {
+
+class DesignDocument;
+
+class ShortCutManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ ShortCutManager();
+
+ void registerActions();
+
+ void connectUndoActions(DesignDocument *designDocument);
+ void disconnectUndoActions(DesignDocument *designDocument);
+ void updateUndoActions(DesignDocument *designDocument);
+ DesignDocument *currentDesignDocument() const;
+
+public slots:
+ void updateActions(Core::IEditor* editor);
+
+private slots:
+ void undo();
+ void redo();
+ void deleteSelected();
+ void cutSelected();
+ void copySelected();
+ void paste();
+ void selectAll();
+ void toggleSidebars();
+ void toggleLeftSidebar();
+ void toggleRightSidebar();
+ void undoAvailable(bool isAvailable);
+ void redoAvailable(bool isAvailable);
+ void goIntoComponent();
+
+private:
+ QAction m_revertToSavedAction;
+ QAction m_saveAction;
+ QAction m_saveAsAction;
+ QAction m_closeCurrentEditorAction;
+ QAction m_closeAllEditorsAction;
+ QAction m_closeOtherEditorsAction;
+ QAction m_undoAction;
+ QAction m_redoAction;
+ Utils::ParameterAction m_deleteAction;
+ Utils::ParameterAction m_cutAction;
+ Utils::ParameterAction m_copyAction;
+ Utils::ParameterAction m_pasteAction;
+ Utils::ParameterAction m_selectAllAction;
+ QAction m_hideSidebarsAction;
+ QAction m_restoreDefaultViewAction;
+ QAction m_toggleLeftSidebarAction;
+ QAction m_toggleRightSidebarAction;
+ QAction m_goIntoComponentAction;
+};
+
+} // namespace QmlDesigner
+
+#endif // QMLDESIGNER_SHORTCUTMANAGER_H