diff options
author | Marco Bubke <marco.bubke@digia.com> | 2013-01-23 12:31:22 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@digia.com> | 2013-01-23 14:53:28 +0100 |
commit | 8d9710c0747a68f9938c8e7d32110f67ba64cc1e (patch) | |
tree | fda8332d2625520be7d282dcdbe20f48ad10f3ed /src/plugins/qmldesigner/shortcutmanager.h | |
parent | a4455f37110f09e326b984977baae286082366ad (diff) | |
download | qt-creator-8d9710c0747a68f9938c8e7d32110f67ba64cc1e.tar.gz |
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.h | 72 |
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 |