55 p_impl->m_on_data_change.connect(std::move(f), client);
63 p_impl->m_on_item_inserted.connect(std::move(f), client);
71 p_impl->m_on_item_removed.connect(std::move(f), client);
79 p_impl->m_on_item_about_removed.connect(std::move(f), client);
86 p_impl->m_on_model_destroyed.connect(std::move(f), client);
93 p_impl->m_on_model_about_reset.connect(std::move(f), client);
100 p_impl->m_on_model_reset.connect(std::move(f), client);
114 p_impl->unsubscribe(client);
122 p_impl->m_on_data_change(item, role);
130 p_impl->m_on_item_inserted(parent, tagrow);
136 p_impl->m_on_item_removed(parent, tagrow);
142 p_impl->m_on_item_about_removed(parent, tagrow);
void callOnItemInserted(SessionItem *parent, const TagRow &tagrow)
Notifies all callbacks subscribed to "item data is changed" event.
std::unique_ptr< ModelMapperImpl > p_impl
void setOnModelAboutToBeReset(Callbacks::model_t f, Callbacks::slot_t client) override
Sets the callback to be notified just before the reset of the root item.
void setOnModelReset(Callbacks::model_t f, Callbacks::slot_t client) override
Sets the callback to be notified right after the root item recreation.
void setOnItemRemoved(Callbacks::item_tagrow_t f, Callbacks::slot_t client) override
Sets callback to be notified on item remove.
void setOnItemInserted(Callbacks::item_tagrow_t f, Callbacks::slot_t client) override
Sets callback to be notified on item insert.
void setOnModelDestroyed(Callbacks::model_t f, Callbacks::slot_t client) override
Sets the callback for notifications on model destruction.
void callOnItemAboutToBeRemoved(SessionItem *parent, const TagRow &tagrow)
void callOnModelAboutToBeReset()
void setOnDataChange(Callbacks::item_int_t f, Callbacks::slot_t client) override
Sets callback to be notified on item's data change.
void setOnAboutToRemoveItem(Callbacks::item_tagrow_t f, Callbacks::slot_t client) override
Sets callback to be notified when the item is about to be removed.
void callOnModelDestroyed()
ModelMapper(SessionModel *model)
void callOnDataChange(SessionItem *item, int role)
Notifies all callbacks subscribed to "item data is changed" event.
void unsubscribe(Callbacks::slot_t client) override
Removes given client from all subscriptions.
void setActive(bool value)
Sets activity flag to given value. Will disable all callbacks if false.
void callOnItemRemoved(SessionItem *parent, const TagRow &tagrow)
The main object representing an editable/displayable/serializable entity.
Main class to hold hierarchy of SessionItem objects.
void remove_client(U client)
Remove client from the list to call back.
Aggregate to hold (tag, row) information for SessionModel.
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.
Signal< Callbacks::model_t > m_on_model_destroyed
Signal< Callbacks::item_tagrow_t > m_on_item_removed
Signal< Callbacks::model_t > m_on_model_reset
void unsubscribe(Callbacks::slot_t client)
Signal< Callbacks::item_tagrow_t > m_on_item_inserted
ModelMapperImpl(SessionModel *model)
Signal< Callbacks::model_t > m_on_model_about_reset
Signal< Callbacks::item_int_t > m_on_data_change
Signal< Callbacks::item_tagrow_t > m_on_item_about_removed