ICF 3.0.5.47
Technical documentation of ICF Libraries
idoc::CSelectedDocModelBinderComp Class Reference

Conditional model-observer binder depending on actual selection. More...

#include <CSelectedDocModelBinderComp.h>

Inheritance diagram for idoc::CSelectedDocModelBinderComp:
Collaboration diagram for idoc::CSelectedDocModelBinderComp:

Public Types

typedef icomp::CComponentBase BaseClass
 
typedef imod::TSingleModelObserverBase< IDocumentManagerBaseClass2
 

Public Member Functions

 CSelectedDocModelBinderComp ()
 
- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context.
 
 CComponentBase (const CComponentBase &)=delete
 
CComponentBaseoperator= (const CComponentBase &)=delete
 
virtual const ICompositeComponentGetParentComponent (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 IComponentContextGetComponentContext () 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.
 
- Public Member Functions inherited from icomp::IComponent

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
 
- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active.
 
virtual const IRealComponentStaticInfoGetComponentStaticInfo () const =0
 Get access to static info of this component.
 
- Protected Member Functions inherited from imod::TSingleModelObserverBase< IDocumentManager >
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.
 
- Protected Member Functions inherited from imod::CSingleModelObserverBase
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::IModelGetObservedModel () const
 Get access to observed model.
 
imod::IModelGetModelPtr () 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.
 
- Protected Member Functions inherited from imod::IObserver

Additional Inherited Members

- Protected Types inherited from imod::TSingleModelObserverBase< IDocumentManager >
typedef CSingleModelObserverBase BaseClass
 
typedef IDocumentManager ModelType
 
- Protected Types inherited from imod::CSingleModelObserverBase
typedef imod::IModel ModelType
 
- Static Protected Member Functions inherited from icomp::CComponentBase
static const IRealComponentStaticInfoInitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 

Detailed Description

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.

Member Typedef Documentation

◆ BaseClass

◆ BaseClass2

Constructor & Destructor Documentation

◆ CSelectedDocModelBinderComp()

idoc::CSelectedDocModelBinderComp::CSelectedDocModelBinderComp ( )

Member Function Documentation

◆ AfterModelChange()

void idoc::CSelectedDocModelBinderComp::AfterModelChange ( imod::IModel * modelPtr,
const istd::IChangeable::ChangeSet & changeSet )
overrideprotectedvirtual

This function will be called after update of the observer contents occures.

Implements imod::IObserver.

◆ BeforeModelChange()

void idoc::CSelectedDocModelBinderComp::BeforeModelChange ( imod::IModel * modelPtr)
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.

◆ OnComponentCreated()

void idoc::CSelectedDocModelBinderComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from icomp::CComponentBase.

◆ OnComponentDestroyed()

void idoc::CSelectedDocModelBinderComp::OnComponentDestroyed ( )
overrideprotectedvirtual

Reimplemented from icomp::CComponentBase.

◆ TryConnectObservers()

void idoc::CSelectedDocModelBinderComp::TryConnectObservers ( )
protected

◆ TryDisconnectObservers()

void idoc::CSelectedDocModelBinderComp::TryDisconnectObservers ( )
protected

The documentation for this class was generated from the following file:

© Witold Gantzke and Kirill Lepskiy