BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
modellistenerinterface.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/interfaces/modellistenerinterface.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_INTERFACES_MODELLISTENERINTERFACE_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_MODELLISTENERINTERFACE_H
17 
19 
20 namespace ModelView {
21 
22 //! Interface to subscribe to various signals generated by SessionModel.
23 
24 class MVVM_MODEL_EXPORT ModelListenerInterface {
25 public:
26  virtual ~ModelListenerInterface() = default;
27 
28  //! Sets callback to be notified on item's data change. The callback will be called
29  //! with (SessionItem*, data_role).
31 
32  //! Sets callback to be notified on item insert. The callback will be called with
33  //! (SessionItem* parent, tagrow), where 'tagrow' denotes inserted child position.
35 
36  //! Sets callback to be notified on item remove. The callback will be called with
37  //! (SessionItem* parent, tagrow), where 'tagrow' denotes child position before the removal.
39 
40  //! Sets callback to be notified when the item is about to be removed. The callback will be
41  //! called with (SessionItem* parent, tagrow), where 'tagrow' denotes child position being
42  //! removed.
44 
45  //! Sets the callback for notifications on model destruction.
47 
48  //! Sets the callback to be notified just before the reset of the root item.
50 
51  //! Sets the callback to be notified right after the root item recreation.
53 
54  //! Removes given client from all subscriptions.
55  virtual void unsubscribe(Callbacks::slot_t client) = 0;
56 };
57 
58 } // namespace ModelView
59 
60 #endif // BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_MODELLISTENERINTERFACE_H
Defines class CLASS?
Interface to subscribe to various signals generated by SessionModel.
virtual void setOnModelDestroyed(Callbacks::model_t f, Callbacks::slot_t client)=0
Sets the callback for notifications on model destruction.
virtual ~ModelListenerInterface()=default
virtual void setOnDataChange(Callbacks::item_int_t f, Callbacks::slot_t client)=0
Sets callback to be notified on item's data change.
virtual void unsubscribe(Callbacks::slot_t client)=0
Removes given client from all subscriptions.
virtual void setOnItemInserted(Callbacks::item_tagrow_t f, Callbacks::slot_t client)=0
Sets callback to be notified on item insert.
virtual void setOnModelReset(Callbacks::model_t f, Callbacks::slot_t client)=0
Sets the callback to be notified right after the root item recreation.
virtual void setOnItemRemoved(Callbacks::item_tagrow_t f, Callbacks::slot_t client)=0
Sets callback to be notified on item remove.
virtual void setOnModelAboutToBeReset(Callbacks::model_t f, Callbacks::slot_t client)=0
Sets the callback to be notified just before the reset of the root item.
virtual void setOnAboutToRemoveItem(Callbacks::item_tagrow_t f, Callbacks::slot_t client)=0
Sets callback to be notified when the item is about to be removed.
std::function< void(SessionModel *)> model_t
std::function< void(SessionItem *, TagRow)> item_tagrow_t
std::function< void(SessionItem *, int)> item_int_t
materialitems.h Collection of materials to populate MaterialModel.