BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
itemlistenerinterface.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/itemlistenerinterface.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_ITEMLISTENERINTERFACE_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMLISTENERINTERFACE_H
17 
19 
20 namespace ModelView {
21 
22 //! Interface to subscribe to various events happening with specific SessionItem.
23 
24 class MVVM_MODEL_EXPORT ItemListenerInterface {
25 public:
26  virtual ~ItemListenerInterface() = default;
27 
29 
30  //! Sets callback to be notified on item's data change.
31  //! Callback will be called with (SessionItem*, data_role).
32 
34 
35  //! Sets callback to be notified on item's property change.
36  //! Callback will be called with (compound_item, property_name).
37 
39 
40  //! Sets callback to be notified on item's children property change.
41  //! Callback will be called with (compound_item, property_name). For MultiLayer containing the
42  //! layer with "thickness" property, the signal will be triggered on thickness change using
43  //! (layeritem*, "thickness") as callback parameters.
44 
46 
47  //! Sets callback to be notified on child insertion.
48  //! Callback will be called with (compound_item, tag, row). For MultiLayer containing the
49  //! T_LAYERS tag, the signal will be triggered on layer insertion with
50  //! (multilayer*, {T_LAYER, row}) as callback parameters.
51 
53 
54  //! Sets callback to be notified on child removal.
55  //! Callback will be called with (compound_item, tag, row). For MultiLayer containing the
56  //! T_LAYERS tag, the signal will be triggered on layer removal with
57  //! (multilayer*, {T_LAYER, oldrow}) as callback parameters.
58 
60 
61  //! Sets callback to be notified when row is about to be removed.
62  //! Callback will be called with (compound_item, tagrow). For MultiLayer containing the
63  //! T_LAYERS tag, the signal will be triggered on layer deletion with
64  //! (multilayer*, {T_LAYER, row}) as callback parameters.
65 
67 
68  //! Removes given client from all subscriptions.
69  virtual void unsubscribe(Callbacks::slot_t client) = 0;
70 };
71 
72 } // namespace ModelView
73 
74 #endif // BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMLISTENERINTERFACE_H
Defines class CLASS?
Interface to subscribe to various events happening with specific SessionItem.
virtual void setOnDataChange(Callbacks::item_int_t f, Callbacks::slot_t owner)=0
Sets callback to be notified on item's data change.
virtual void setOnItemDestroy(Callbacks::item_t f, Callbacks::slot_t owner)=0
virtual void setOnItemInserted(Callbacks::item_tagrow_t f, Callbacks::slot_t owner)=0
Sets callback to be notified on child insertion.
virtual void setOnAboutToRemoveItem(Callbacks::item_tagrow_t f, Callbacks::slot_t owner)=0
Sets callback to be notified when row is about to be removed.
virtual void unsubscribe(Callbacks::slot_t client)=0
Removes given client from all subscriptions.
virtual void setOnPropertyChange(Callbacks::item_str_t f, Callbacks::slot_t owner)=0
Sets callback to be notified on item's property change.
virtual ~ItemListenerInterface()=default
virtual void setOnItemRemoved(Callbacks::item_tagrow_t f, Callbacks::slot_t owner)=0
Sets callback to be notified on child removal.
virtual void setOnChildPropertyChange(Callbacks::item_str_t f, Callbacks::slot_t owner)=0
Sets callback to be notified on item's children property change.
std::function< void(SessionItem *, std::string)> item_str_t
std::function< void(SessionItem *, TagRow)> item_tagrow_t
std::function< void(SessionItem *, int)> item_int_t
std::function< void(SessionItem *)> item_t
materialitems.h Collection of materials to populate MaterialModel.