BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
standardviewmodelcontrollers.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/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.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_VIEWMODEL_MVVM_VIEWMODEL_STANDARDVIEWMODELCONTROLLERS_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDVIEWMODELCONTROLLERS_H
17 
20 #include <string>
21 #include <vector>
22 
23 //! @file mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h
24 //! Collection of standard controllers for AbstractViewModel.
25 
26 namespace ModelView {
27 
28 //! Controller for AbstractViewModel to show all items of SessionModel.
29 //! The layout corresponds to original SessionModel, generates standard label/value tree.
30 
31 class MVVM_VIEWMODEL_EXPORT DefaultViewModelController : public ViewModelController {
32 public:
33  explicit DefaultViewModelController(SessionModel* session_model, ViewModelBase* view_model);
34 };
35 
36 //! Controller for AbstractViewModel to show top level items.
37 //! Shows only top level items, property items, group items are hidden.
38 
39 class MVVM_VIEWMODEL_EXPORT TopItemsViewModelController : public ViewModelController {
40 public:
41  explicit TopItemsViewModelController(SessionModel* session_model, ViewModelBase* view_model);
42 };
43 
44 //! Controller for AbstractViewModel to show item properties.
45 //! Shows property items, hides top level items, hides inactive items of GroupProperty.
46 
47 class MVVM_VIEWMODEL_EXPORT PropertyViewModelController : public ViewModelController {
48 public:
49  explicit PropertyViewModelController(SessionModel* session_model, ViewModelBase* view_model);
50 
51 protected:
52  void onDataChange(SessionItem* item, int role) override;
53 };
54 
55 //! Controller for AbstractViewModel to show item properties in table layout.
56 //! Shows all property items and place them in table columns.
57 
58 class MVVM_VIEWMODEL_EXPORT PropertyTableViewModelController : public ViewModelController {
59 public:
61  const std::vector<std::string>& labels = {});
62 };
63 
64 //! Controller for AbstractViewModel to show item properties.
65 //! Shows property items, hides top level items, hides inactive items of GroupProperty,
66 //! moves subproperties of group item under parent of group item.
67 
68 class MVVM_VIEWMODEL_EXPORT PropertyFlatViewModelController : public ViewModelController {
69 public:
70  explicit PropertyFlatViewModelController(SessionModel* session_model,
71  ViewModelBase* view_model);
72 
73 protected:
74  void onDataChange(SessionItem* item, int role) override;
75 };
76 
77 } // namespace ModelView
78 
79 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDVIEWMODELCONTROLLERS_H
Controller for AbstractViewModel to show all items of SessionModel.
Controller for AbstractViewModel to show item properties.
Controller for AbstractViewModel to show item properties in table layout.
Controller for AbstractViewModel to show item properties.
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Main class to hold hierarchy of SessionItem objects.
Definition: sessionmodel.h:37
Controller for AbstractViewModel to show top level items.
Base class for all view models to show content of SessionModel in Qt views.
Definition: viewmodelbase.h:31
Propagates changes from SessionModel to its ViewModelBase.
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Defines class CLASS?