|
ACF $AcfVersion:0$
|
Component for binding of more observers to a data model. More...
#include <CMultiObserverBinderComp.h>
Public Types | |
| typedef icomp::CComponentBase | BaseClass |
Public Types inherited from imod::IModelEditor | |
| enum | ChangeFlags { CF_INIT_EDITOR = 0x3720694 } |
| Data model change notification flags. More... | |
Public Member Functions | |
| CMultiObserverBinderComp () | |
| virtual bool | IsModelAttached (const imod::IModel *modelPtr=NULL) const override |
| Checks if the specified model is currently attached to this observer. | |
| virtual bool | OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override |
| Callback invoked when an observable model is about to be attached to this observer. | |
| virtual bool | OnModelDetached (imod::IModel *modelPtr) override |
| Callback invoked when an observable model is about to be detached from this observer. | |
| virtual void | BeforeUpdate (imod::IModel *modelPtr) override |
| Callback invoked before an update of the observer's content occurs. | |
| virtual void | AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override |
| Callback invoked after an update of the observer's content occurs. | |
| virtual void | UpdateEditor (const istd::IChangeable::ChangeSet &changeSet) override |
| Updates editor with model data. | |
| virtual void | UpdateModelFromEditor () const override |
| Updates model from editor. | |
| virtual bool | IsReadOnly () const override |
Returns true if the model data can be changed. | |
| virtual void | SetReadOnly (bool state) override |
| Set flag that the model data can be changed. | |
Public Member Functions inherited from icomp::CComponentBase | |
| CComponentBase () | |
| Create component and assign it to specific context. | |
| virtual const icomp::IComponent * | GetParentComponent (bool ownerOnly=false) const override |
| Get parent of this component. | |
| virtual void * | GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") override |
| Get access to specified component interface. | |
| virtual IComponentContextSharedPtr | GetComponentContext () const override |
| Get access to component context describing all application-specified component information loaded from components registry. | |
| virtual void | SetComponentContext (const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override |
| Set component context of this component. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Protected Member Functions | |
| virtual void | OnComponentDestroyed () override |
Protected Member Functions inherited from icomp::CComponentBase | |
| bool | IsComponentActive () const |
| Check if component is active. | |
| virtual void | OnComponentCreated () |
| virtual const icomp::IRealComponentStaticInfo & | GetComponentStaticInfo () const =0 |
| Get access to static info of this component. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from icomp::CComponentBase | |
| static const icomp::IRealComponentStaticInfo & | InitStaticInfo (IComponent *componentPtr) |
| static QByteArray | GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray()) |
Component for binding of more observers to a data model.
All methods calls of imod::IModelEditor and imod::IObserver interfaces are delegated to underlaying observers specified in multi-component-reference m_observersCompPtr and m_modelEditorsCompPtr. This allows forking of observer functionality from a central location.
Definition at line 25 of file CMultiObserverBinderComp.h.
Definition at line 31 of file CMultiObserverBinderComp.h.
| ibase::CMultiObserverBinderComp::CMultiObserverBinderComp | ( | ) |
|
overridevirtual |
Callback invoked after an update of the observer's content occurs.
This is the primary notification method where observers react to model changes. It's called after the model has finished updating its state. The implementation should examine the changeSet to determine what changed and update accordingly.
| modelPtr | Pointer to the model that has changed |
| changeSet | Contains information about what changed in the model. Use changeSet.Contains(changeId) to check for specific changes. The changeSet respects the mask specified in OnModelAttached(). |
Implements imod::IObserver.
|
overridevirtual |
Callback invoked before an update of the observer's content occurs.
This method is called at the start of a model update cycle, before any data actually changes. It allows the observer to prepare for the update, such as saving current state for comparison or disabling UI updates temporarily.
| modelPtr | Pointer to the model that is about to change |
Implements imod::IObserver.
|
overridevirtual |
Checks if the specified model is currently attached to this observer.
This method allows querying whether a specific model is being observed, or whether any model at all is attached.
| modelPtr | Pointer to the model object to check. If nullptr, checks whether any model is attached to this observer. |
Implements imod::IObserver.
|
overridevirtual |
Returns true if the model data can be changed.
Implements imod::IModelEditor.
|
overrideprotectedvirtual |
Reimplemented from icomp::CComponentBase.
|
overridevirtual |
Callback invoked when an observable model is about to be attached to this observer.
This method is called by the model when attempting to establish an observer relationship. The implementation should:
| modelPtr | Pointer to the model object being attached. Never nullptr. |
| changeMask | Output parameter where the observer specifies which change types it wants to be notified about. Set the appropriate change flags using changeMask.Set(changeId). An empty mask means the observer wants all changes. |
Implements imod::IObserver.
|
overridevirtual |
Callback invoked when an observable model is about to be detached from this observer.
This method is called when the observer-model relationship is being terminated, either explicitly or because the model is being destroyed. The implementation should clean up any state or resources related to this model.
| modelPtr | Pointer to the model object being detached |
Implements imod::IObserver.
|
overridevirtual |
Set flag that the model data can be changed.
Implements imod::IModelEditor.
|
overridevirtual |
Updates editor with model data.
This method will be called only if GUI is connected.
| changeSet | the same as changeSet in istd::IChangeable. |
Implements imod::IModelEditor.
|
overridevirtual |
Updates model from editor.
This method will be called only if GUI is connected and model is attached.
Implements imod::IModelEditor.