diff options
Diffstat (limited to 'src/plugins/projectexplorer/project.h')
-rw-r--r-- | src/plugins/projectexplorer/project.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 87af5aaa5f..a54828e54d 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -30,6 +30,7 @@ #include "kit.h" #include <coreplugin/id.h> +#include <coreplugin/idocument.h> #include <utils/fileutils.h> @@ -38,11 +39,7 @@ #include <functional> -namespace Core { -class IDocument; -class Context; -} - +namespace Core { class Context; } namespace Utils { class MacroExpander; } namespace ProjectExplorer { @@ -58,6 +55,24 @@ class ProjectPrivate; class Session; class Target; +// Auto-registers with the DocumentManager if a callback is set! +class PROJECTEXPLORER_EXPORT ProjectDocument : public Core::IDocument +{ +public: + using ProjectCallback = std::function<void()>; + + ProjectDocument(const QString &mimeType, const Utils::FileName &fileName, + const ProjectCallback &callback = {}); + + Core::IDocument::ReloadBehavior reloadBehavior(Core::IDocument::ChangeTrigger state, + Core::IDocument::ChangeType type) const final; + bool reload(QString *errorString, Core::IDocument::ReloadFlag flag, + Core::IDocument::ChangeType type) final; + +private: + ProjectCallback m_callback; +}; + // Documentation inside. class PROJECTEXPLORER_EXPORT Project : public QObject { |