BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
projectmanager.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/model/mvvm/project/projectmanager.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_PROJECT_PROJECTMANAGER_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_PROJECT_PROJECTMANAGER_H
17 
19 #include <memory>
20 
21 namespace ModelView {
22 
23 struct ProjectContext;
24 
25 //! Responsible for handling new/save/save-as/close Project logic, where the Project represents
26 //! a collection of serialized application models in the project directory.
27 
28 //! This ProjectManager requires certain prerequisites to function properly: for example,
29 //! the creation of a new project will be possible only if the old project is in a saved state. See
30 //! description to the class methods.
31 
32 class MVVM_MODEL_EXPORT ProjectManager : public ModelView::ProjectManagerInterface {
33 public:
34  ProjectManager(const ProjectContext& context);
35  ~ProjectManager() override;
36 
37  ProjectManager(const ProjectManager& other) = delete;
38  ProjectManager& operator=(const ProjectManager& other) = delete;
39 
40  bool createNewProject(const std::string& dirname) override;
41 
42  bool saveCurrentProject() override;
43 
44  bool saveProjectAs(const std::string& dirname) override;
45 
46  bool openExistingProject(const std::string& dirname) override;
47 
48  std::string currentProjectDir() const override;
49 
50  bool isModified() const override;
51 
52  bool closeCurrentProject() const override;
53 
54 private:
55  struct ProjectManagerImpl;
56  std::unique_ptr<ProjectManagerImpl> p_impl;
57 };
58 
59 } // namespace ModelView
60 
61 #endif // BORNAGAIN_MVVM_MODEL_MVVM_PROJECT_PROJECTMANAGER_H
Interface class for ProjectManager family.
Responsible for handling new/save/save-as/close Project logic, where the Project represents a collect...
ProjectManager & operator=(const ProjectManager &other)=delete
std::unique_ptr< ProjectManagerImpl > p_impl
ProjectManager(const ProjectManager &other)=delete
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Provides necessary information for Project construction.
Definition: project_types.h:32