BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides sets of methods to subscribe to various signals generated by SessionItem. More...
Public Member Functions | |
ItemListenerBase (const ItemListenerBase &other)=delete | |
ItemListenerBase (SessionItem *item=nullptr) | |
virtual | ~ItemListenerBase () |
ItemListenerBase & | operator= (const ItemListenerBase &other)=delete |
void | setItem (SessionItem *item) |
void | setOnAboutToRemoveItem (Callbacks::item_tagrow_t f) |
void | setOnChildPropertyChange (Callbacks::item_str_t f) |
Sets callback to be notified on item's children property change. More... | |
void | setOnDataChange (Callbacks::item_int_t f) |
Sets callback to be notified on item's data change. More... | |
void | setOnItemDestroy (Callbacks::item_t f) |
void | setOnItemInserted (Callbacks::item_tagrow_t f) |
Sets callback to be notified on child insertion. More... | |
void | setOnItemRemoved (Callbacks::item_tagrow_t f) |
Sets callback to be notified on child removal. More... | |
void | setOnPropertyChange (Callbacks::item_str_t f) |
Sets callback to be notified on item's property change. More... | |
Protected Member Functions | |
SessionItem * | item () const |
For necessary manipulations on unsubscription. More... | |
virtual void | subscribe () |
virtual void | unsubscribe () |
For necessary manipulations on new item. More... | |
Private Member Functions | |
void | unsubscribe_from_current () |
Private Attributes | |
SessionItem * | m_item {nullptr} |
Provides sets of methods to subscribe to various signals generated by SessionItem.
Used to implement user actions on item change. Automatically tracks the time of life of SessionItem. Unsubscribes from the item on own destruction. Can be switched from tracking one item to another of the same type.
Definition at line 31 of file itemlistenerbase.h.
|
explicit |
Definition at line 19 of file itemlistenerbase.cpp.
References item(), and setItem().
|
virtual |
Definition at line 24 of file itemlistenerbase.cpp.
|
delete |
|
protected |
For necessary manipulations on unsubscription.
Sets callback to be notified when row is about to be removed.
Callback will be called with (compound_item, tagrow). For MultiLayer containing the T_LAYERS tag, the signal will be triggered on layer deletion with (multilayer*, {T_LAYER, row}) as callback parameters.
Definition at line 112 of file itemlistenerbase.cpp.
Referenced by ItemListenerBase(), ModelView::ItemListener< T >::currentItem(), ModelView::Data1DPlotController::Data1DPlotControllerImpl::initGraphFromItem(), ModelView::ViewportAxisPlotController::AxesPlotControllerImpl::setConnected(), ModelView::PenController::PenControllerImpl::update_graph_from_item(), ModelView::AxisTitleController::AxisTitleControllerImpl::updateAxisFromItem(), ModelView::Data1DPlotController::Data1DPlotControllerImpl::updateErrorBarsFromItem(), ModelView::Data1DPlotController::Data1DPlotControllerImpl::updateGraphPointsFromItem(), ModelView::ViewportAxisPlotController::AxesPlotControllerImpl::updateLowerRange(), and ModelView::ViewportAxisPlotController::AxesPlotControllerImpl::updateUpperRange().
|
delete |
void ModelView::ItemListenerBase::setItem | ( | ModelView::SessionItem * | item | ) |
Definition at line 30 of file itemlistenerbase.cpp.
Referenced by ItemListenerBase(), and TEST_F().
void ModelView::ItemListenerBase::setOnAboutToRemoveItem | ( | Callbacks::item_tagrow_t | f | ) |
Definition at line 102 of file itemlistenerbase.cpp.
Referenced by ModelView::GraphViewportPlotController::subscribe().
void ModelView::ItemListenerBase::setOnChildPropertyChange | ( | Callbacks::item_str_t | f | ) |
Sets callback to be notified on item's children property change.
Callback will be called with (compound_item, property_name). For MultiLayer containing the layer with "thickness" property, the signal will be triggered on thickness change using (layeritem*, "thickness") as callback parameters.
Definition at line 77 of file itemlistenerbase.cpp.
void ModelView::ItemListenerBase::setOnDataChange | ( | Callbacks::item_int_t | f | ) |
Sets callback to be notified on item's data change.
Callback will be called with (SessionItem*, data_role).
Definition at line 59 of file itemlistenerbase.cpp.
Referenced by ModelView::Data2DPlotController::subscribe().
void ModelView::ItemListenerBase::setOnItemDestroy | ( | Callbacks::item_t | f | ) |
Definition at line 51 of file itemlistenerbase.cpp.
void ModelView::ItemListenerBase::setOnItemInserted | ( | Callbacks::item_tagrow_t | f | ) |
Sets callback to be notified on child insertion.
Callback will be called with (compound_item, tag, row). For MultiLayer containing the T_LAYERS tag, the signal will be triggered on layer insertion with (multilayer*, {T_LAYER, row}) as callback parameters.
Definition at line 87 of file itemlistenerbase.cpp.
Referenced by ModelView::ColorMapViewportPlotController::subscribe(), and ModelView::GraphViewportPlotController::subscribe().
void ModelView::ItemListenerBase::setOnItemRemoved | ( | Callbacks::item_tagrow_t | f | ) |
Sets callback to be notified on child removal.
Callback will be called with (compound_item, tag, row). For MultiLayer containing the T_LAYERS tag, the signal will be triggered on layer removal with (multilayer*, {T_LAYER, oldrow}) as callback parameters.
Definition at line 97 of file itemlistenerbase.cpp.
void ModelView::ItemListenerBase::setOnPropertyChange | ( | Callbacks::item_str_t | f | ) |
Sets callback to be notified on item's property change.
Callback will be called with (compound_item, property_name).
Definition at line 67 of file itemlistenerbase.cpp.
Referenced by ModelView::AxisTitleController::subscribe(), ModelView::ColorMapPlotController::subscribe(), ModelView::ColorScalePlotController::subscribe(), ModelView::Data1DPlotController::subscribe(), ModelView::GraphPlotController::subscribe(), ModelView::PenController::subscribe(), and ModelView::ViewportAxisPlotController::subscribe().
|
inlineprotectedvirtual |
Reimplemented in ModelView::ViewportAxisPlotController, ModelView::PenController, ModelView::GraphViewportPlotController, ModelView::GraphPlotController, ModelView::Data2DPlotController, ModelView::Data1DPlotController, ModelView::ColorScalePlotController, ModelView::ColorMapViewportPlotController, ModelView::ColorMapPlotController, ModelView::AxisTitleController, and ItemListenerTest::TestController.
Definition at line 50 of file itemlistenerbase.h.
|
inlineprotectedvirtual |
For necessary manipulations on new item.
Reimplemented in ModelView::ViewportAxisPlotController, ModelView::GraphPlotController, ModelView::Data2DPlotController, ModelView::Data1DPlotController, ModelView::ColorMapViewportPlotController, ModelView::ColorMapPlotController, and ItemListenerTest::TestController.
Definition at line 51 of file itemlistenerbase.h.
|
private |
Definition at line 117 of file itemlistenerbase.cpp.
|
private |
Definition at line 56 of file itemlistenerbase.h.