![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Conditional model-observer binder depending on actual selection. More...
#include <CSelectedDocModelBinderComp.h>
Public Types | |
typedef icomp::CComponentBase | BaseClass |
typedef imod::TSingleModelObserverBase< IDocumentManager > | BaseClass2 |
Public Member Functions | |
CSelectedDocModelBinderComp () | |
![]() | |
CComponentBase () | |
Create component and assign it to specific context. | |
CComponentBase (const CComponentBase &)=delete | |
CComponentBase & | operator= (const CComponentBase &)=delete |
virtual const ICompositeComponent * | GetParentComponent (bool ownerOnly=false) const |
Get parent of this component. | |
virtual void * | GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") |
Get access to specified component interface. | |
virtual const IComponentContext * | GetComponentContext () const |
Get access to component context describing all application-specified component information loaded from components registry. | |
virtual void | SetComponentContext (const IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner) |
Set component context of this component. | |
![]() |
Protected Member Functions | |
void | TryConnectObservers () |
void | TryDisconnectObservers () |
void | BeforeModelChange (imod::IModel *modelPtr) override |
This function will be called before update of the observer contents occures. | |
void | AfterModelChange (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override |
This function will be called after update of the observer contents occures. | |
void | OnComponentCreated () override |
void | OnComponentDestroyed () override |
![]() | |
bool | IsComponentActive () const |
Check if component is active. | |
virtual const IRealComponentStaticInfo & | GetComponentStaticInfo () const =0 |
Get access to static info of this component. | |
![]() | |
virtual IDocumentManager * | CastFromModel (imod::IModel *modelPtr) const |
TSingleModelObserverBase () | |
IDocumentManager * | GetObservedObject () const |
Get instance of observed object. | |
IDocumentManager * | GetObjectPtr () const |
Get instance of observed object. | |
bool | AttachOrSetObject (IDocumentManager *objectPtr) |
Attach to model of object or set object pointer, if no connection is possible. | |
bool | OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override |
This call back function will be called, if an observable object is about to be attached. | |
bool | OnModelDetached (imod::IModel *modelPtr) override |
This call back function will be called, if an observable object is about to be detached. | |
![]() | |
void | SetModelPtr (imod::IModel *modelPtr) |
Set internal model pointer to specified value. | |
virtual void | OnUpdate (const istd::IChangeable::ChangeSet &changeSet) |
Called on update of observed model. | |
CSingleModelObserverBase () | |
virtual | ~CSingleModelObserverBase () |
imod::IModel * | GetObservedModel () const |
Get access to observed model. | |
imod::IModel * | GetModelPtr () const |
Get access to observed model. | |
void | EnsureModelDetached () |
Make sure this observer is detached. | |
void | SetObservedIds (const istd::IChangeable::ChangeSet &changeMask) |
Set list of ID's beeing observed. | |
bool | IsModelAttached (const imod::IModel *modelPtr=nullptr) const override |
Check if specified model is attached. | |
void | BeforeModelChange (imod::IModel *modelPtr) override |
This function will be called before update of the observer contents occures. | |
void | AfterModelChange (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override |
This function will be called after update of the observer contents occures. | |
![]() |
Additional Inherited Members | |
![]() | |
typedef CSingleModelObserverBase | BaseClass |
typedef IDocumentManager | ModelType |
![]() | |
typedef imod::IModel | ModelType |
![]() | |
static const IRealComponentStaticInfo & | InitStaticInfo (IComponent *componentPtr) |
static QByteArray | GetComponentId (const IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray()) |
Conditional model-observer binder depending on actual selection.
This component allows to work-around of problems with observing of selected document or view. It connects model with observer only if some document (or view) is currently selected. Please note, that there is no assumption that connected model must be the same as observed model.
Definition at line 28 of file CSelectedDocModelBinderComp.h.
Definition at line 33 of file CSelectedDocModelBinderComp.h.
Definition at line 34 of file CSelectedDocModelBinderComp.h.
idoc::CSelectedDocModelBinderComp::CSelectedDocModelBinderComp | ( | ) |
|
overrideprotectedvirtual |
This function will be called after update of the observer contents occures.
Implements imod::IObserver.
|
overrideprotectedvirtual |
This function will be called before update of the observer contents occures.
Please note, that in some cases no following AfterModelChange can be called.
Implements imod::IObserver.
|
overrideprotectedvirtual |
Reimplemented from icomp::CComponentBase.
|
overrideprotectedvirtual |
Reimplemented from icomp::CComponentBase.
|
protected |
|
protected |
© Witold Gantzke and Kirill Lepskiy